Skip to main content

Automatic CAPTCHA solving for Selenium. Detects Cloudflare Turnstile, reCAPTCHA, and hCaptcha and solves them via GateSolve.

Project description

gatesolve-selenium

Automatic CAPTCHA solving for Selenium WebDriver. Detects Cloudflare Turnstile, reCAPTCHA, and hCaptcha and solves them via GateSolve.

Install

pip install gatesolve-selenium

Quick Start

One-shot: Solve CAPTCHA on current page

from selenium import webdriver
from gatesolve_selenium import solve_on_page

driver = webdriver.Chrome()
driver.get("https://example.com/login")

# Detect and solve any CAPTCHA
result = solve_on_page(driver, api_key="gs_your_key_here")

if result and result.success:
    print(f"Solved {result.type} in {result.solve_time_ms:.0f}ms")
    driver.find_element("css selector", 'button[type="submit"]').click()

Auto-solve: Patch driver

from selenium import webdriver
from gatesolve_selenium import with_gatesolve

driver = webdriver.Chrome()
driver = with_gatesolve(driver, api_key="gs_your_key_here", debug=True)

# CAPTCHAs are solved automatically after every driver.get()
driver.get("https://protected-site.com")

Detect only

from gatesolve_selenium import detect_captcha

detection = detect_captcha(driver)
if detection:
    print(f"Found {detection.type} with siteKey {detection.site_key}")

API

solve_on_page(driver, api_key=None, opts=None, **kwargs)

Detect and solve a CAPTCHA on the current page. Returns SolveResult | None.

with_gatesolve(driver, api_key=None, opts=None, **kwargs)

Patch a WebDriver to auto-solve CAPTCHAs after every get() call. Returns the same driver.

detect_captcha(driver)

Detect CAPTCHA type and siteKey without solving. Returns CaptchaDetection | None.

Options

Option Type Default Description
api_key str required GateSolve API key
base_url str https://gatesolve.dev API base URL
timeout float 30.0 Max solve wait (seconds)
poll_interval float 2.0 Poll frequency (seconds)
debug bool False Log debug info

Supported CAPTCHAs

  • Cloudflare Turnstile — $0.02/solve
  • reCAPTCHA v2/v3 — $0.03/solve
  • hCaptcha — $0.03/solve

Free Tier

100 free solves per API key. No credit card required. gatesolve.dev

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gatesolve_selenium-0.1.0.tar.gz (5.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

gatesolve_selenium-0.1.0-py3-none-any.whl (5.9 kB view details)

Uploaded Python 3

File details

Details for the file gatesolve_selenium-0.1.0.tar.gz.

File metadata

  • Download URL: gatesolve_selenium-0.1.0.tar.gz
  • Upload date:
  • Size: 5.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for gatesolve_selenium-0.1.0.tar.gz
Algorithm Hash digest
SHA256 d7eaa282feef785999561d0453c8b6385198210ef4379426b3cdf737c2d854f7
MD5 1379664ed487d6e67103bf3e6d4dcb0d
BLAKE2b-256 9e6f8a0b27253a8cfc061896e4e7cc2e1109fee085a0b27635ebc63cc70e8ec2

See more details on using hashes here.

File details

Details for the file gatesolve_selenium-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for gatesolve_selenium-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 231836de0961511c98ce357e500e026f3d830c48402d56ab732ffb15262258d1
MD5 133cb0ddeb90b269ca26b9e0b0fbcf7f
BLAKE2b-256 8dfbb3791697cda7a0b8d59b7a050efae0a441b56127be5a803ffe3478ac1666

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page