Browse Source

fix(spiders/ai_seo/kimi.py): 增加等待时间并处理取消按钮

master
zzx 2 weeks ago
parent
commit
212874fda6
  1. 6
      spiders/ai_seo/kimi.py

6
spiders/ai_seo/kimi.py

@ -66,7 +66,11 @@ class KimiSpider(AbstractAiSeoSpider):
# 监听请求 # 监听请求
# self.browser_page.on('response', partial(self.__listen_response)) # self.browser_page.on('response', partial(self.__listen_response))
# await self.completed_event.wait() # await self.completed_event.wait()
await asyncio.sleep(2)
await asyncio.sleep(6)
cancel_btn = self.browser_page.locator('//button[text()="取消"]')
if await cancel_btn.is_visible():
await cancel_btn.click()
# 等待复制按钮可见 # 等待复制按钮可见
copy_btn_xpath = "//div[@class='segment-assistant-actions-content']/div[@class='simple-button size-small'][1]" copy_btn_xpath = "//div[@class='segment-assistant-actions-content']/div[@class='simple-button size-small'][1]"

Loading…
Cancel
Save