From 54a6969df3a7c8ddf63f9788d54f1a6d32ed8297 Mon Sep 17 00:00:00 2001 From: work Date: Thu, 21 Aug 2025 18:32:13 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=94=B9=E8=AF=AD=E8=A8=80=E5=90=8C?= =?UTF-8?q?=E6=97=B6=E8=8E=B7=E5=8F=96=E5=B8=A6=E7=A9=BA=E6=A0=BC=E7=9A=84?= =?UTF-8?q?=E5=92=8C=E4=B8=8D=E5=B8=A6=E7=A9=BA=E6=A0=BC=E7=9A=84style?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- spider/task.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/spider/task.py b/spider/task.py index 74425f9..b3d1b06 100644 --- a/spider/task.py +++ b/spider/task.py @@ -25,7 +25,7 @@ from exceptions import AuthException, OperationFailed from miniofile import client, put_object # 登录, 检查账号, 获取账号配置, 更新账号配置是否隐藏浏览器 -HEADLESS = True +HEADLESS = False def sleep(a, b=None): @@ -59,8 +59,11 @@ def update_windows_distinguish(x=1920, y=1080): def _change_language(page): sleep(2, 3) # 找到顶部头像按钮并点击 - page.wait_for_selector('div[role="button"] svg image[style*="height:40px"][style*="width:40px"]', - timeout=10000).click(force=True) + selector = ''' + div[role="button"] svg image[style*="height: 40px"][style*="width: 40px"], + div[role="button"] svg image[style*="height:40px"][style*="width:40px"] + ''' + page.wait_for_selector(selector, timeout=10000).click(force=True) sleep(1, 2) # 点击设置图标 page.wait_for_selector('//div[@role="list"]/div[@role="listitem"][1]', timeout=30000).click(force=True)