Browse Source

refactor: kimi脚本实现登录状态检测

master
zzx 2 months ago
parent
commit
11084f58ce
  1. 8
      spiders/ai_seo/kimi.py

8
spiders/ai_seo/kimi.py

@ -17,7 +17,13 @@ logger = create_logger(__name__)
class KimiSpider(AbstractAiSeoSpider):
async def do_check_session(self) -> bool:
pass
self.completed_event = asyncio.Event()
await self.browser_page.goto(self.get_home_url(), timeout=300000)
await asyncio.sleep(3)
user_name_element = self.browser_page.locator("//span[@class='user-name']")
if await user_name_element.is_visible() and not await user_name_element.text_content() == '登录':
return True
return False
def __init__(self, browser: Browser, prompt: str, keyword: str, think: bool = False):
super().__init__(browser, prompt, keyword, think)

Loading…
Cancel
Save