|
|
|
@ -34,16 +34,16 @@ class MetasoSpider(AbstractAiSeoSpider): |
|
|
|
self.browser_page.on('response', partial(self.__listen_response)) |
|
|
|
await self.browser_page.goto(self.get_home_url(), timeout=600000) |
|
|
|
await asyncio.sleep(2) |
|
|
|
info = await self.browser_page.wait_for_selector('#left-menu > div > div.LeftMenu_footer__qsJdJ > div > div > div > button', timeout=600000) |
|
|
|
info = await self.browser_page.wait_for_selector('//*[@id="left-menu"]/div/div[3]/div/div/div', timeout=600000) |
|
|
|
await info.click() |
|
|
|
|
|
|
|
edu = await self.browser_page.wait_for_selector( |
|
|
|
'//div[@aria-label="每天有100搜索额度"]/following-sibling::div[1]//span[contains(@class, "MuiTypography-root")]', |
|
|
|
timeout=600000) |
|
|
|
edu_txt= await edu.text_content() |
|
|
|
if edu_txt == '0': |
|
|
|
await AiSeoApis.update_spider_session(self.session_info['id'], 3) |
|
|
|
raise "session额度已用完!" |
|
|
|
# edu = await self.browser_page.wait_for_selector( |
|
|
|
# '//div[@aria-label="每天有100搜索额度"]/following-sibling::div[1]//span[contains(@class, "MuiTypography-root")]', |
|
|
|
# timeout=600000) |
|
|
|
# edu_txt= await edu.text_content() |
|
|
|
# if edu_txt == '0': |
|
|
|
# await AiSeoApis.update_spider_session(self.session_info['id'], 3) |
|
|
|
# raise "session额度已用完!" |
|
|
|
# 开始操作 |
|
|
|
chat_input_element = self.browser_page.locator("//textarea[contains(@class, 'search-consult-textarea')]") |
|
|
|
# 输入提问词 |
|
|
|
|