Skip to main content

A lightweight python library for solving hCaptcha challenges with selenium.

Project description

hcaptcha-solver

PyPI - Status PyPI PyPI - Downloads

a lightweight Python library for solving hCaptcha challenges with selenium and neural networks

Installation

pip install hcaptcha-solver

Usage

from hcaptcha_solver import hcaptcha_solver
from selenium import webdriver

# create Captcha_Solver object to load ML models
captcha_solver = hcaptcha_solver.Captcha_Solver()

# create webdriver and access website with hCaptcha
options = webdriver.ChromeOptions()
options.add_experimental_option('prefs', {'intl.accept_languages': 'en,en_US'}) # set to english
driver = webdriver.Chrome(options=options)
driver.get("https://accounts.hcaptcha.com/demo")

# check for hCaptcha
captcha_solver.is_captcha_present(driver)

# solve hCaptcha
captcha_solver.solve_captcha(driver)

Functionality

Only v1 hCaptchas are supported - any other captcha types will be skipped. The correct images are selected using Convolutional Neural Networks trained on labeled hCaptcha data. The models are chosen by inspecting the captcha header, so the language has to be english in order for the matching to work.

The package features models for a handful of hCaptcha tasks. The currently available models and their labeling accuracies are visualized in the figure below. Note that the accuracy was measured on training data and is therefore inflated.

The model availability and performance will be improved over time.

Current Model Labeling Performance

Model Labeling Accuracy

Current Data Availability

Data Availability

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

To help collecting captchas, run dev/main.ipynb and submit the results. In this notebook you can also explore the data availability and train models.

updated 13/08/2023

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

hcaptcha_solver-0.2.12.tar.gz (78.5 MB view details)

Uploaded Source

Built Distribution

hcaptcha_solver-0.2.12-py2.py3-none-any.whl (78.5 MB view details)

Uploaded Python 2 Python 3

File details

Details for the file hcaptcha_solver-0.2.12.tar.gz.

File metadata

  • Download URL: hcaptcha_solver-0.2.12.tar.gz
  • Upload date:
  • Size: 78.5 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.3

File hashes

Hashes for hcaptcha_solver-0.2.12.tar.gz
Algorithm Hash digest
SHA256 6a746fa9bb31d1da191756b3ac5e853cd8bbebde1f1dd9e77712d6cdd9b6f53d
MD5 619e58009c02a36e189768c1de54d359
BLAKE2b-256 a21d6fa03cd4e939687fe3e22aa3a9fb365391ceed472a0bf91616f57ce6b883

See more details on using hashes here.

File details

Details for the file hcaptcha_solver-0.2.12-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for hcaptcha_solver-0.2.12-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 c92b66379772d0a392fadb9b40bce79b421da1bc64b93dc66d1d9106f95a9635
MD5 cdf3202d86372d97e12296355a957074
BLAKE2b-256 c4bcf587e57f67d416828d0ec43cb829735575c4a3eec46f2eeb6b72cf4e48b6

See more details on using hashes here.

Supported by

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