From ac93ca5e3b84c994fd9ddcb588b618a2971c3b6c Mon Sep 17 00:00:00 2001 From: zzx Date: Mon, 15 Sep 2025 22:41:37 +0800 Subject: [PATCH] =?UTF-8?q?refactor(ai=5Fseo):=20=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E4=B8=80=E8=A8=80=E8=9C=98=E8=9B=9B=E7=9A=84=E6=80=9D=E8=80=83?= =?UTF-8?q?=E6=A8=A1=E5=BC=8F=E9=80=89=E6=8B=A9=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 修改思考模式按钮的定位方式,使用更准确的文本匹配 - 点击思考模式后,直接选择第二个模式选项,无需检查是否已激活 --- spiders/ai_seo/yiyan.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/spiders/ai_seo/yiyan.py b/spiders/ai_seo/yiyan.py index 344f5bc..bee44e7 100644 --- a/spiders/ai_seo/yiyan.py +++ b/spiders/ai_seo/yiyan.py @@ -35,10 +35,9 @@ class YiYanSpider(AbstractAiSeoSpider): # 检查登录状态 await self.check_login() if self.think: - think_btn = self.browser_page.locator("//span[text()='思考(X1 Turbo)']/parent::div") - clazz = await think_btn.get_attribute('class') - if 'active' not in clazz: - await think_btn.click() + think_btn = self.browser_page.locator("//span[text()='思考·自动']/parent::div") + await think_btn.click() + await self.browser_page.locator("//div[contains(@class, 'dtModeItem__')][2]").click() # 开始操作 chat_input_element = self.browser_page.locator("//div[@class='yc-editor']") await chat_input_element.click()