Skip to main content

Automated reCAPTCHA V2 and V3 solver using Selenium for Python bots.

Project description

Anti-reCaptcha

Anti-reCaptcha is a Python module designed to automatically solve Google's reCAPTCHA V2 and V3 challenges. Powered by Selenium, it enables full browser automation and human-like interactions, making it ideal for bot developers, automation workflows, and penetration testing tools.

Key Features

  • 🔓 Automatic bypass for reCAPTCHA V2 checkbox and audio challenges
  • 🧠 Intelligent handling of reCAPTCHA V3 score-based verification
  • 🌐 Compatible with headless browsers and proxies
  • 🧪 Built for Selenium, tested with Undetected ChromeDriver

Whether you're building automated scripts, scraping data, or testing CAPTCHA behavior, Anti-reCaptcha is your plug-and-play solution for dealing with Google’s CAPTCHA systems.

🔴 reCaptchaV3 bypass does not work on all sites. Test on your target to find out.

🐍 Support Python >= 3.7

Installation

Install from PyPI

pip install anti-recaptcha

To Upgrade

pip install anti-recaptcha --upgrade

Install from Github (latest repo code)

pip install git+https://github.com/dragon0041/Anti-reCaptcha@master

Bypassing reCaptchaV3

To bypass reCAPTCHA V3, first extract the anchor URL:

  • Open inspect-element on your browser.

  • Go to the web page that has reCaptcha V3 (not V2 invisible).

  • In Network tab you should see many requests.

  • Type anchor in text-field filter to hide unnecessary requests.

  • Now you should see a url like this:

    https://www.google.com/recaptcha/api2/anchor?ar=1&k=6LfCVLAUAAAAFwwRnnCFW_J39&co=aHR....

    pass this url to reCaptchaV3 class:

Note that the anchor urls also can have /enterprise/anchor instead of /api2/anchor in other sites.

from anti_recaptcha import reCaptchaV3

reCaptcha_response = reCaptchaV3('ANCHOR URL')
## use this response in your request ...

Proxy

from anti_recaptcha import reCaptchaV3
from anti_recaptcha.structs import Proxy

## Using Proxy structure
proxy = Proxy(Proxy.type.HTTPs,'HOST','PORT')

## with authentication credentials
# proxy = Proxy(Proxy.type.HTTPs,'HOST','PORT','USERNAME', 'PASSWORD')

reCaptcha_response = reCaptchaV3('ANCHOR URL', proxy)

also you can configure it as Dict.

proxy = {"http": "http://HOST:PORT",
         "https": "https://HOST:PORT"}

reCaptcha_response = reCaptchaV3('ANCHOR URL', proxy)

Timeout

Default timeout is 20 seconds but you can change the amount like this:

from anti_recaptcha import reCaptchaV3

reCaptcha_response = reCaptchaV3('ANCHOR URL', timeout = 10)

Bypassing reCaptchaV2

Before start using reCaptchaV2 solver, you must install the following requirements.

Requirements :

  • PocketSphinx (used as speech-to-text engine)
  • ffmpeg (used for audio format conversion)

After installing requirements, you should pass your webdriver to reCaptchaV2 class then anti-recaptcha tries to solve the reCaptcha V2 which is in current tab of browser.

from anti_recaptcha import reCaptchaV2

# Create an instance of webdriver and open the page has recaptcha v2
# ...

# pass the driver to reCaptchaV2
is_checked = reCaptchaV2(driver_instance) # it returns bool

Arguments

driver: An instance of webdriver.
Play: Click on 'PLAY' button. [Default is True means it plays the audio].
Attempts: Maximum solving attempts for a recaptcha. [Default is 3 times].

is_checked = reCaptchaV2(
                    driver = driver_instance,
                    play = False,
                    attempts = 5
                  )

Note that Google gonna blocks you if you try to solve many recaptcha via audio challenge. In this case anti-recaptcha raises IpBlock exception.

Exception

Exception Bypass Description
ConnectionError reCaptchaV3 Raised due to network connectivity-related issues.
RecaptchaTokenNotFound reCaptchaV3 Raised when couldn't find token due to wrong anchor_url.
RecaptchaResponseNotFound reCaptchaV3 Raised when couldn't find reCaptcha response due to using anti-recaptcha for site that hasn't reCaptchaV3.
IpBlock reCaptchaV2 Raised due to solving many recaptcha via audio challenge.

Legal Disclaimer

This was made for educational purposes only, nobody which directly involved in this project is responsible for any damages caused. You are responsible for your actions.

 

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

anti_recaptcha-0.0.3.tar.gz (14.1 kB view details)

Uploaded Source

Built Distribution

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

anti_recaptcha-0.0.3-py3-none-any.whl (15.6 kB view details)

Uploaded Python 3

File details

Details for the file anti_recaptcha-0.0.3.tar.gz.

File metadata

  • Download URL: anti_recaptcha-0.0.3.tar.gz
  • Upload date:
  • Size: 14.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for anti_recaptcha-0.0.3.tar.gz
Algorithm Hash digest
SHA256 b60992df943d03d3bf52ac191e355575eefdcda5d7e85598f7b62a127b88bd8a
MD5 a2b9ad6d87dea033f3b4a6699e19d761
BLAKE2b-256 1c28d66af7072a74bd4e9a3f4dcbd867afee71bf5490f7f7a119a716cc57b952

See more details on using hashes here.

File details

Details for the file anti_recaptcha-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: anti_recaptcha-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 15.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for anti_recaptcha-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 1ec7b7f5be49e1076abbc8b5d4cad1899b0e4afd3dab968d7fc6128bdd1aa8cc
MD5 0361fd633eb94ef955d3a2bc90176dab
BLAKE2b-256 fe8bf0d3fa8efe0c1aefaf555b3f49b0c828bc41f95b56583496496b80dae581

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