How to get past hCaptcha asking to select similar images ? #2892
-
While implementing an automated screenshot taking logic for a Url, the site is asking for selecting similar images possibly due to the detection of bot by hCaptcha . I am using Manually navigating to the Url in the browser is working. Code from seleniumbase import SB
fallback_ua = 'Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Mobile Safari/537.36'
chromium_arg = '--disable-gpu,--disable-blink-features=AutomationControlled'
with SB(uc=True, headless2=True, agent=fallback_ua, chromium_arg=chromium_arg) as sb:
url = "https://www.royalmail.com/track-your-item#/tracking-results/QF085212272GB"
sb.uc_open_with_reconnect(url, 3)
sb.save_screenshot('myimage.png') Result Dockerized environment: python3.9-slim seleniumbase: 4.28.0 Chromium Browser: Chromium 126.0.6478.126 built on Debian 12.5, running on Debian 12.5 Chrome Driver: ChromeDriver 126.0.6478.126 (d36ace6122e0a59570e258d82441395206d60e1c-refs/branch-heads/6478@{#1591}) |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 9 replies
-
It looks like you're changing things that you shouldn't be. Use this instead: from seleniumbase import SB
with SB(uc=True) as sb:
url = "https://www.royalmail.com/track-your-item#/tracking-results/QF085212272GB"
sb.uc_open_with_reconnect(url, 4)
sb.save_screenshot("myimage.png") Don't use headless mode, don't change the default user-agent, and don't set chromium args in UC Mode. |
Beta Was this translation helpful? Give feedback.
It looks like you're changing things that you shouldn't be. Use this instead:
Don't use headless mode, don't change the default user-agent, and don't set chromium args in UC Mode.