Solving reCAPTCHA v3 with Playwright

Solving reCAPTCHA v3 with Playwright

Posted on 2026-09-22 | 2 min read | Category: Playwright | By DeathByCaptcha Engineering Team

Playwright


reCAPTCHA v3 returns a score (0.0 to 1.0) instead of a challenge. It tracks user behavior across the session. For automation, you need to solve v3 by generating tokens with appropriate scores. DeathByCaptcha handles v3 token generation.

How reCAPTCHA v3 Works

  1. The page loads reCAPTCHA v3 with a sitekey and action (e.g., "login").
  2. reCAPTCHA runs silently in the background.
  3. It returns a token with a score (0.0 = bot, 1.0 = human).
  4. The server validates the token against the score threshold.

Detecting reCAPTCHA v3

# Check for reCAPTCHA v3
v3_script = page.query_selector("script[src*=recaptcha/enterprise?render=]")
if v3_script:
    src = v3_script.get_attribute("src")
    sitekey = src.split("render=")[1].split("&")[0]
    print(f"reCAPTCHA v3 sitekey: {sitekey}")

Solving with DeathByCaptcha

reCAPTCHA v3 uses type=5:

import json
from playwright.sync_api import sync_playwright
import deathbycaptcha

client = deathbycaptcha.SocketClient(username, password)

with sync_playwright() as p:
    browser = p.chromium.launch(headless=True)
    page = browser.new_page()
    page.goto("https://example.com/login")

    v3_script = page.query_selector("script[src*=recaptcha/enterprise?render=]")
    sitekey = v3_script.get_attribute("src").split("render=")[1].split("&")[0]

    result = client.decode(type=5, token_params=json.dumps({
        "googlekey": sitekey,
        "pageurl": "https://example.com/login",
        "action": "login"
    }))
    print("Solution:", result["text"])

    page.evaluate("document.querySelector(\"[name=g-recaptcha-response]\").value=\"%s\"" % result["text"])
    page.click("button[type=submit]")

    browser.close()

Key Differences from v2

  • Type parameter: Use type=5 for v3, type=4 for visible v2, type=2 for invisible v2.
  • No challenge: v3 never shows a visual challenge. It returns a score.
  • Action parameter: Pass the action string (e.g., "login", "checkout") used in the page.
  • Score handling: The API returns tokens with scores. Higher scores pass more validation.

Enterprise vs Standard

Enterprise reCAPTCHA v3 has additional features:

  • Custom scoring rules per action.
  • WAF integration for real-time blocking.
  • Analytics dashboard for token usage.

Pass the enterprise flag for enterprise tokens:

result = client.decode(type=5, token_params=json.dumps({
    "googlekey": sitekey,
    "pageurl": page_url,
    "action": "login",
    "enterprise": True
}))

Troubleshooting

  • Score too low: Increase the timeout parameter for better token quality.
  • Action mismatch: Ensure the action parameter matches what the page expects.
  • Domain mismatch: The pageurl must match the domain where reCAPTCHA is loaded.

For API documentation, see the API reference and client libraries.

Common pitfalls

  • Using a CAPTCHA solving service for illegitimate purposes instead of legitimate automation and testing.
  • Hard-coding credentials or API keys in client-side code that users can inspect.
  • Sending the wrong CAPTCHA type parameter, which returns incorrect or empty responses.
  • Failing to poll for the solution status and not handling timeouts gracefully.
  • Scaling automation without monitoring error rates, response times, and CAPTCHA type coverage.
DBC
Written by DeathByCaptcha Engineering Team
DeathByCaptcha engineers build and operate the CAPTCHA solving technology behind this site. Articles are written by our technical team and checked for accuracy before publishing.
Reviewed by DeathByCaptcha Editorial Team

Get your API key — start solving

Free to try · No credit card · Python, Node.js, Java, C# SDKs

Get your API key


Status: OK

Servers are fully operational with faster than average response time.
  • Average solving time
  • -- seconds - Normal CAPTCHAs (1 min. ago)
  • 21 seconds - reCAPTCHA V2, V3 (1 min. ago)
  • 13 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