From 229380f636a182c27a32d4a1f0e8c316a80a009c Mon Sep 17 00:00:00 2001 From: bvwl <2201101122@qq.com> Date: Thu, 20 Nov 2025 23:39:38 +0800 Subject: [PATCH] 0.0.9 --- README.md | 2 ++ spider/main.py | 9 +++++++++ 2 files changed, 11 insertions(+) diff --git a/README.md b/README.md index 52c134c..4f85a6a 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,5 @@ +# 0.0.9 +- 修正cloudflare验证 # 0.0.8 - 修正api地址 # 0.0.7 diff --git a/spider/main.py b/spider/main.py index 266d161..ea528f6 100644 --- a/spider/main.py +++ b/spider/main.py @@ -30,6 +30,11 @@ class Auto: shadow2 = iframe.ele('x:/html/body').shadow_root if shadow2: logger.debug("找到Cloudflare iframe body shadow root") + status = shadow2.ele( + 'x://span[text()="Verifying..."]', timeout=0.5) + if status: + tab.wait(3) + continue status = shadow2.ele( 'x://span[text()="Success!"]', timeout=0.5) if status: @@ -71,6 +76,10 @@ class Auto: else: logger.debug("Cloudflare验证成功.") self.tab.wait(1.5) + bol = self.tab.ele('t:h1@text():Sorry, you have been blocked', timeout=1) + if bol: + logger.debug("ip被ban秒") + return False html = self.tab.url logger.debug(f"当前URL: {html}") if 'https://veritaconnect.ca/canadianbreadsettlement/en-us' == html: