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.13.tar.gz (78.5 MB view details)

Uploaded Source

Built Distributions

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

Uploaded Python 3

hcaptcha_solver-0.2.13-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.13.tar.gz.

File metadata

  • Download URL: hcaptcha_solver-0.2.13.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.13.tar.gz
Algorithm Hash digest
SHA256 0916c0ff6473f146fdaf81d154a7da945f0a6769c257264019d737926641c8b9
MD5 41edac3bb4d2647f0f4002580214aa9a
BLAKE2b-256 f799896f9bec15fedd00e5cd8b051cccba1f6abefcb041598fbc7de70af3a3f6

See more details on using hashes here.

File details

Details for the file hcaptcha_solver-0.2.13-py3-none-any.whl.

File metadata

File hashes

Hashes for hcaptcha_solver-0.2.13-py3-none-any.whl
Algorithm Hash digest
SHA256 b38e98a5529d0bc5c97aa07bc7db28c8d18537aef45bf03d6d8044bb80fc11c5
MD5 ea6c6fe76077e5de68ee2b86d7057b8c
BLAKE2b-256 4e8d090fb672184ac4df4dc1a50d262ff46c134b0c6d335351fe7cad14fc5a69

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for hcaptcha_solver-0.2.13-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 6f5884b06e3ef03d5a852a0c9ef4eb643face64d60c7f0ae7e9aa14a31aa6ebc
MD5 5b2556b9ed4e037c880604a84208c753
BLAKE2b-256 865539bebefc0ffbd76c8f439eba220c63d574d23e425f68389736d65186be7a

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