From 28f65913988a693c4c8a04180936e655d595a149 Mon Sep 17 00:00:00 2001 From: "C.C" Date: Tue, 17 Dec 2024 10:45:14 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=A2=9E=E5=8A=A0=E9=80=82=E5=BD=93?= =?UTF-8?q?=E7=9A=84=E5=BB=B6=E8=BF=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/plugins/modules/_autosignin/yemapt.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/app/plugins/modules/_autosignin/yemapt.py b/app/plugins/modules/_autosignin/yemapt.py index e9601334..b5c2472e 100644 --- a/app/plugins/modules/_autosignin/yemapt.py +++ b/app/plugins/modules/_autosignin/yemapt.py @@ -42,24 +42,27 @@ def signin(self, site_info: dict): # 访问首页 html_text = chrome.get_page_html(url="https://www.yemapt.org/#/index", - cookies=site_cookie + cookies=site_cookie, + delay=5 ) # 签到 if "注册新用户" not in html_text: html_text = chrome.get_page_html(url="https://www.yemapt.org/#/consumer/checkIn", cookies=site_cookie, - click_xpath='xpath://li[contains(@data-menu-id, "/consumer/checkIn")]' + click_xpath='xpath://li[contains(@data-menu-id, "/consumer/checkIn")]', + delay=2 ) - if "已签到" in html_text: + if html_text and "已签到" in html_text: self.info("今日已签到") return True, f'【{site}】今日已签到' html_text = chrome.get_page_html(url="https://www.yemapt.org/#/consumer/checkIn", cookies=site_cookie, - click_xpath='xpath://span[@class="ant-statistic-content-suffix"]' + click_xpath='xpath://span[@class="ant-statistic-content-suffix"]', + delay=2 ) # 签到成功 - if "已签到" in html_text: + if html_text and "已签到" in html_text: self.info("签到成功") return True, f'【{site}】签到成功' else: