Playwright Captcha Solver: Wire Death By Captcha into Your Automation
Description and use
A Playwright script automatically solves reCAPTCHA v2 via Death By Captcha, injecting the token and proceeding without UI interaction.
Problem
reCAPTCHA challenges interrupt headless Playwright automation, causing runs to fail mid‑flow.
Outcome
The script prints "solved" when the token is accepted, otherwise it raises a TimeoutError, ensuring failures are explicit.
Workflow
- Read challenge parameters (sitekey and page URL) from the page
- Check DBC account balance
- Upload captcha to DBC with type=4 and token_params
- Poll DBC for solution token until solved or timeout
- Inject the token into the page’s hidden input and trigger the widget’s callback
- Submit the form and wait for success indicator
Evidence
Playwright makes browser automation fast — until a captcha challenge stops the run mid‑flow.
The script reads the challenge parameters from the page, requests a solution from the DBC API, injects the token back into the page, and continues
If the token is accepted, the script prints solved and exits 0. If the challenge is not solved within the timeout it raises — a broken integration fails loudly instead of hanging your pipeline.
- Record date: 2026-10-14T12:41:16.151Z