automates the process of solving reCAPTCHA challenges on web pages when using Selenium
pip install solvacaptcha
Tested against Windows 10 / Python 3.10 / Anaconda
This function automates the process of solving reCAPTCHA challenges on web pages.
It uses audio-based CAPTCHA challenges as an example and employs audio recording,
transcription, and interaction with web elements to solve the challenge.
It is recommended to install: Virtual Audio Cable (VAC) - the free version is more than enough
https://vac.muzychenko.net/en/download.htm
Parameters:
driver: WebDriver
The Selenium WebDriver instance.
expected_conditions: module
The module containing expected conditions for WebDriver waits.
WebDriverWait: class
The class for setting up explicit waits with WebDriver.
By: class
The class for locating elements with WebDriver.
ffmpegexe: str
The path to the FFmpeg executable for audio processing.
sleep_after_recording_started: int, optional
Time to sleep (in seconds) after audio recording starts.
sleep_after_each_click: int, optional
Time to sleep (in seconds) after each interaction/click.
captchatitle: str, optional
The CSS selector for identifying the CAPTCHA challenge element.
language: str, optional
The spoken language for audio transcription.
cpus: int, optional
Number of CPU cores to use during audio processing.
blas: bool, optional
Whether to use BLAS acceleration for audio processing.
audiodevice: int, optional
Index of the audio device for recording.
silent_seconds_stop: int, optional
Duration of silence to stop audio recording (in seconds).
silence_threshold: int, optional
Threshold for silence detection during audio recording.
selector: tuple of tuples, optional
CSS selectors for identifying various CAPTCHA interaction elements.
Returns:
None
Note:
This function automates solving a specific type of audio-based reCAPTCHA challenge. It records audio,
transcribes it to text, interacts with the CAPTCHA elements, and submits the solution.
Example:
from selenium.webdriver.support import expected_conditions
from selenium.webdriver.support.wait import WebDriverWait
from selenium.webdriver.common.by import By
from operagxdriver import start_opera_driver
from solvacaptcha import solva_captcha
driver = start_opera_driver(
opera_browser_exe=r"C:\Program Files\Opera GX\opera.exe",
opera_driver_exe=r"C:\ProgramData\anaconda3\envs\dfdir\operadriver.exe",
userdir="c:\\operabrowserprofile2",
arguments=(
"--no-sandbox",
"--test-type",
"--no-default-browser-check",
"--no-first-run",
"--incognito",
"--start-maximized",
),
)
driver.get("https://www.google.com/recaptcha/api2/demo")
solva_captcha(
driver,
expected_conditions,
WebDriverWait,
By,
ffmpegexe=r"C:\ffmpeg\ffmpeg.exe",
sleep_after_recording_started=10,
sleep_after_each_click=10,
captchatitle='[title="reCAPTCHA"]',
language="en",
cpus=5,
blas=True,
audiodevice=0,
silent_seconds_stop=3,
silence_threshold=-30,
selector=(
("button", "audio", "outerHTML"),
("button", ">PLAY<", "outerHTML"),
("input", 'id="audio-response"', "outerHTML"),
("button", ">Verify<", "outerHTML"),
),
)
Metadata
Release files for solvacaptcha 0.10
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| solvacaptcha-0.10.tar.gz | 7.6 kB | Without provenance | Details for solvacaptcha-0.10.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| solvacaptcha-0.10-py3-none-any.whl | Python 3 | none | any | Details for solvacaptcha-0.10-py3-none-any.whl |
Total release size: 17.1 kB
Release files / solvacaptcha-0.10.tar.gz
| Download URL | solvacaptcha-0.10.tar.gz |
|---|---|
| Size | 7.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
420a573fcc5ae53005f9d46e90b50c19bca312588d331bab71cde0fbb7d75525
|
|
BLAKE2b-256 checksum How to use checksums |
a3b80d5fb4f2480569aa2dd3c3ee9c971ef2ad144f15ea66e3289a0081446ff6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.10.10
|
Release files / solvacaptcha-0.10-py3-none-any.whl
| Download URL | solvacaptcha-0.10-py3-none-any.whl |
|---|---|
| Size | 9.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ad16e2c2fe128120eee5ffb449110de89175b707bd38d0c5d414e92e09d738de
|
|
BLAKE2b-256 checksum How to use checksums |
8aa96c1cccd434b6ea29c1947b2734c5afa931c3cf80df232ddd6c72e06dab49
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.10.10
|
Security for solvacaptcha 0.10
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.