-
Notifications
You must be signed in to change notification settings - Fork 1.4k
-
🚀 Feature Proposal: Integration of reCAPTCHA Solvers into SeleniumBase
I’ve been testing automated reCAPTCHA solvers using selenium_recaptcha_solver and the Buster extension, but only in vanilla selenium.webdriver.
✅ Code Example Using selenium_recaptcha_solver
This works but is easily detected as a bot due to raw Selenium usage:
from selenium_recaptcha_solver import RecaptchaSolver from selenium.webdriver.common.by import By from selenium import webdriver from selenium.webdriver.chrome.options import Options from selenium.webdriver.chrome.service import Service import os os.environ["PATH"] += os.pathsep + r"C:\Path\to\ffmpeg\bin" test_ua = 'Mozilla/5.0 (Windows NT 4.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2049.0 Safari/537.36' options = Options() options.add_argument("--window-size=1920,1080") options.add_argument(f'--user-agent={test_ua}') options.add_argument('--no-sandbox') options.add_argument("--disable-extensions") chromedriver_path = "C:/path/to/chromedriver.exe" service = Service(executable_path=chromedriver_path) test_driver = webdriver.Chrome(service=service, options=options) solver = RecaptchaSolver(driver=test_driver) test_driver.get('https://www.google.com/recaptcha/api2/demo') recaptcha_iframe = test_driver.find_element(By.XPATH, '//iframe[@title="reCAPTCHA"]') solver.click_recaptcha_v2(iframe=recaptcha_iframe)
❓Proposal
Would it be possible to:
Add native support for selenium_recaptcha_solver into SeleniumBase, so it can be run like:
sb.cdp.solve_recaptcha(iframe="iframe[title='reCAPTCHA']")
Beta Was this translation helpful? Give feedback.
All reactions
Replies: 1 comment 3 replies
-
The stealthy mode in SeleniumBase
is CDP Mode, but the driver
from WebDriver is disconnected when CDP Mode is activated.
It looks like RecaptchaSolver
relies on the WebDriver being available, which it wouldn't be if you need the stealth.
However, you can load an unpacked extension in CDP Mode by adding the extension_dir
arg during the SB()
initialization step.
Beta Was this translation helpful? Give feedback.
All reactions
-
I kept trying and found a way to bypass Recaptcha V2 on https://www.google.com/recaptcha/api2/demo with this code:
from seleniumbase import SB from selenium_recaptcha_solver import RecaptchaSolver from selenium.webdriver.common.by import By import os os.environ["PATH"] += os.pathsep + r"C:\Seleniumbase_projects\selenium_recaptcha_solver\ffmpeg-2025年07月21日-git-8cdb47e47a-full_build\bin" with SB(uc=True, headless=False) as sb: solver = RecaptchaSolver(driver=sb.driver) sb.open('https://www.google.com/recaptcha/api2/demo') recaptcha_iframe = sb.find_element('//iframe[@title="reCAPTCHA"]') solver.click_recaptcha_v2(iframe=recaptcha_iframe) input("Press Enter to close the browser...")
this driver=sb.driver and this iframe=recaptcha_iframe show me this warning
Argument of type Unknown | None cannot be assigned to parameter driver of type WebDriver in function __init__ Type Unknown | None is not assignable to type WebDriver None is not assignable to WebDriver
but work anyway so...
Beta Was this translation helpful? Give feedback.
All reactions
-
Looks like selenium-recaptcha-solver
has heavy Python dependency requirements, so it's best not to be included directly with SeleniumBase
, because I want to keep SeleniumBase as lightweight as possible, but people can certainly use selenium-recaptcha-solver and other repos alongside Seleniumbase.
Beta Was this translation helpful? Give feedback.
All reactions
-
👍 2
-
yes, sadly only the ffmpeg and the speech_recognition combined >100MB but now we can say that Seleniumbase can bypass ReCaptcha v2 😎.
Update:
Also work in this site https://2captcha.com/pt/demo/recaptcha-v2 so i think work in all other sites with ReCaptcha v2
Beta Was this translation helpful? Give feedback.