From 1533100cb49ec7bf349fbf49227761c35c70bfff Mon Sep 17 00:00:00 2001 From: bvwl <2201101122@qq.com> Date: Wed, 26 Nov 2025 09:15:27 +0800 Subject: [PATCH] 0.1.7 --- README.md | 2 ++ spider/main.py | 22 +++++++++++++++++++++- 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 6df819c..dbfa34e 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,5 @@ +# 0.1.7 +- 修复自动bug # 0.1.6 - 信息变为本地生成 # 0.1.5 diff --git a/spider/main.py b/spider/main.py index 734e9b2..ac79305 100644 --- a/spider/main.py +++ b/spider/main.py @@ -93,6 +93,13 @@ class Auto: if bol: logger.debug("ip被ban秒") return False + + bol = self.tab.ele( + 't:div@text():ERR_TIMED_OUT', timeout=1) + if bol: + logger.debug("刷新网页") + self.tab.refresh() + self.tab.wait(1.5) bol = self.tab.ele( 't:div@text():ERR_SSL_PROTOCOL_ERROR', timeout=1) if bol: @@ -151,6 +158,13 @@ class Auto: # self.tab.wait(1) # return self.click_continue(bl=True) + bol = self.tab.ele( + 't:div@text():ERR_TIMED_OUT', timeout=1) + if bol: + logger.debug("刷新网页") + self.tab.refresh() + self.tab.wait(1.5) + bol = self.tab.ele( 't:div@text():ERR_SSL_PROTOCOL_ERROR', timeout=1) if bol: @@ -190,10 +204,10 @@ class Auto: if 'https://veritaconnect.ca/canadianbreadsettlement/en-us/Claimant/UnknownClaimForm' in html: logger.debug("成功进入问卷界面") return True + jc += 1 except Exception as e: logger.error(f"点击Continue按钮异常: {e}") self.tab.wait(1) - return False # 随机取城市 def get_random_city(self, province: str | None = None): @@ -476,6 +490,12 @@ class Auto: ) return True + bol = self.tab.ele( + 't:div@text():ERR_TIMED_OUT', timeout=1) + if bol: + logger.debug("刷新网页") + self.tab.refresh() + self.tab.wait(1.5) bol = self.tab.ele( 't:div@text():ERR_SSL_PROTOCOL_ERROR', timeout=1) if bol: