Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Feature Proposal: Integrate Recaptcha Solvers into SeleniumBase (Buster / selenium_recaptcha_solver) #3899

Pedro0152 started this conversation in Ideas
Discussion options

🚀 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']")
You must be logged in to vote

Replies: 1 comment 3 replies

Comment options

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.

You must be logged in to vote
3 replies
Comment options

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...

Comment options

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.

Comment options

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Ideas
Labels
None yet

AltStyle によって変換されたページ (->オリジナル) /