Playwright Captcha Solver: Wire Death By Captcha into Your Automation
Описание и применение
Скрипт на Playwright автоматически решает reCAPTCHA v2, используя Death By Captcha, и продолжает выполнение без ручного вмешательства.
Задача
reCAPTCHA challenges interrupt headless Playwright automation, causing runs to fail mid‑flow.
Результат
The script prints "solved" when the token is accepted, otherwise it raises a TimeoutError, ensuring failures are explicit.
Рабочий процесс
- 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
Доказательства
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.
- Дата записи: 2026-10-14T12:41:16.151Z