This sample demonstrates how to solve Google reCAPTCHA v2 with Playwright 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_playwright_example.py- runnable Playwright example.env.example- credentials templaterequirements.txt- Playwright-specific dependencies
- Python virtual environment active
- This package installed (
pip install -e .) - Playwright browsers installed (
playwright install)
From repo root:
pip install -e .
pip install -r examples/deathbycaptcha-python-playwright/requirements.txt
playwright install
cp examples/deathbycaptcha-python-playwright/.env.example examples/deathbycaptcha-python-playwright/.envEdit examples/deathbycaptcha-python-playwright/.env and set:
DBC_USERNAME=your_username
DBC_PASSWORD=your_passwordcd examples/deathbycaptcha-python-playwright
python python_playwright_example.pyHEADLESS=1to force headless mode locally
Example:
HEADLESS=1 python python_playwright_example.py- This is a functional sample for testing/integration workflows.
- Never commit real credentials in
.env.