Skip to content

Commit

Permalink
fix: 增加适当的延迟
Browse files Browse the repository at this point in the history
  • Loading branch information
linyuan0213 committed Dec 17, 2024
1 parent 82316d4 commit 28f6591
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions app/plugins/modules/_autosignin/yemapt.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 28f6591

Please sign in to comment.