This sample demonstrates how to solve Google reCAPTCHA v2 with Selenium using the deathbycaptcha-official client from this repository.
- Opens Google's reCAPTCHA v2 demo page
- Extracts
data-sitekey - Requests a token from DeathByCaptcha (
type=4) - Injects the token into
g-recaptcha-response - Submits and validates the result
python_selenium_example.py- runnable Selenium example.env.example- credentials templaterequirements.txt- Selenium-specific dependencies
- Python virtual environment active
- This package installed (
pip install -e .) - Browser + WebDriver installed
- Firefox + geckodriver, or
- Chrome + chromedriver
From repo root:
pip install -e .
pip install -r examples/deathbycaptcha-python-selenium/requirements.txt
cp examples/deathbycaptcha-python-selenium/.env.example examples/deathbycaptcha-python-selenium/.envEdit examples/deathbycaptcha-python-selenium/.env and set:
DBC_USERNAME=your_username
DBC_PASSWORD=your_passwordcd examples/deathbycaptcha-python-selenium
python python_selenium_example.pyBROWSER=firefox|chrome(default:firefox)HEADLESS=1to force headless mode locally
Example:
BROWSER=chrome HEADLESS=1 python python_selenium_example.py- This is a functional sample for testing/integration workflows.
- Never commit real credentials in
.env.