Open leadscloud opened 1 month ago
You're wrong if google translates your words correctly. You can bypass captcha using built-in DrssionPage click method.
Here is my code that I tested now and works without issues:
driver = self.create_new_driver()
driver.get(target)
print(f"[{self.thread_id}] Browser started [PID: {driver.process_id}]")
time.sleep(8.0 if not self.summary.emulation_force else 12.0)
if "access denied" in driver.title.lower():
raise Exception('Access Denied')
if "needs to review the security" in driver.html or "just a moment" in driver.title.lower():
print(f'[{self.thread_id}] Captcha detected!')
bypass_failed_times = 0
while bypass_failed_times < 2:
try:
challenge_frame = driver.ele("ANTI COPY-PASTE", timeout=1).sr.ele("t:iframe", timeout=1) # Can be outdated in the future
challenge_iframe_body = challenge_frame.ele("ANTI COPY-PASTE", timeout=1).sr
challenge_button = challenge_iframe_body.ele("t:input", timeout=1)
challenge_button.click()
break
except Exception:
bypass_failed_times += 1
print(f"[{self.thread_id}] {bypass_failed_times=}/2")
time.sleep(2.0)
... LOGIC GOES HERE
模拟鼠标可以点击成功,但无法绕过cloudflare的turnstile验证,我测试了下,只要真正的鼠标点击下就能立即过。但程序page.actions的点击是无法通过的。
模拟的鼠标行为估计是检测到了。