Selenium Captcha Solver Integration

This page helps Selenium teams integrate captcha solving with stable, repeatable workflows for test and automation pipelines.

Death By Captcha (DBC) lets Selenium scripts resolve captcha challenges through the API instead of manual interaction: your script extracts the challenge parameters from the page, requests a solution from DBC, injects the result back into the page, and continues the flow. This page is the quickstart: installation, a runnable code sample, and supported task notes.

Installation

Python:

pip install selenium deathbycaptcha-official

Use your DBC account credentials in the client. Create an account and check pricing and balance before running the flow.

Code sample: reCAPTCHA v2 token flow (Python + Selenium), adapted from the official runnable example.

import json
import os
import time

import deathbycaptcha
from selenium import webdriver
from selenium.webdriver.common.by import By

USERNAME = os.getenv('DBC_USERNAME')
PASSWORD = os.getenv('DBC_PASSWORD')
DEMO_URL = 'https://www.google.com/recaptcha/api2/demo'

def solve_recaptcha_v2(driver):
    # 1. extract the challenge parameters from the page
    sitekey = driver.find_element(By.ID, 'recaptcha-demo').get_attribute('data-sitekey')
    token_params = json.dumps({'googlekey': sitekey, 'pageurl': DEMO_URL})

    client = deathbycaptcha.SocketClient(USERNAME, PASSWORD)
    if client.get_balance() <= 0:
        raise SystemExit('No balance - top up before solving.')

    # 2. request the solution token from DBC (type 4 = reCAPTCHA v2 token)
    result = client.decode(type=4, token_params=token_params)
    return result['text'] if result else None

driver = webdriver.Firefox()
driver.get(DEMO_URL)

token = solve_recaptcha_v2(driver)
if not token:
    print('No solution yet - retry with backoff')
    raise SystemExit(1)


# 3. inject the token back into the page
driver.execute_script("document.getElementById('g-recaptcha-response').value = arguments[0]", token)

# 4. submit and wait for the success element
driver.find_element(By.ID, 'recaptcha-demo-submit').click()
time.sleep(2)
print(driver.find_element(By.CLASS_NAME, 'recaptcha-success').text)
driver.quit()

Full runnable version: examples/deathbycaptcha-python-selenium in the official Python client repository

Where Selenium Teams Usually Struggle

  • Flaky solves causing intermittent test failures.
  • Inconsistent challenge handling across environments.
  • Weak retry and timeout strategy under high concurrency.

Selenium Integration Matrix

Need Selenium context DBC path
Stable token workflow Deterministic handling in repeated automation runs. API-driven token flow with explicit retry/time bounds.
Type coverage Different projects hit different challenge classes. Use type-specific endpoints and validate each scenario separately.
Operational support Production issues need quick diagnosis. Support and reliability surfaces for escalation and planning.

Supported task notes

Topic Note
Captcha types (API) reCAPTCHA v2 and v3, Cloudflare Turnstile, GeeTest, DataDome, and image/text captchas.
Flow Extract the sitekey from the page, request the token from the DBC API (type 4), inject it back and submit the form.
Balance Solutions are paid from the account balance; check it before decoding.
Retries No solution returned means transient: retry with backoff, as the official example does.
API vs extension This flow uses the API inside your script; the browser extension is the no-code path for manual browsing.
Supported browsers Any WebDriver-supported browser; the official sample runs on Firefox and Chrome.

Implementation next step

For Selenium captcha solver deployment, confirm stable token flow first, then connect reliability and pricing pages to finalize production planning.


Status: OK

Servers are fully operational with faster than average response time.
  • Average solving time
  • 4 seconds - Normal CAPTCHAs (1 min. ago)
  • 16 seconds - reCAPTCHA V2, V3 (1 min. ago)
  • 14 seconds - others (1 min. ago)
Chrome and Firefox logos
Browser extensions available

Updates

  1. May 13: Crypto payments got better! You can now purchase your CAPTCHAs using cryptocurrency through the Hekelet payment processor at https://deathbycaptcha.com/user-pay and receive an extra 20% FREE CAPTCHA credit with every package purchased this way.
  2. Apr 15: GitHub Updates: We’ve upgraded our libraries, expanded sample code, enhanced documentation, and added support for C++ and Go, making integration smoother than ever. Explore what’s new at github.com/deathbycaptcha!
  3. Jan 27: RESOLVED - If your email to one of our official addresses ([email protected], [email protected], or [email protected]) has bounced or you haven’t received a response, please try resending it or reach out via our Live Chat Support at https://deathbycaptcha.com/es/contact.

  4. Previous updates…

Support

Our system is designed to be completely user-friendly and easy-to-use. Should you have any trouble with it, simply email us at DBC technical support emailcom, and a support agent will get back to you as soon as possible.

Live Support

Available Monday to Friday (10am to 4pm EST) Live support image. Link to live support page