# automates the process of solving reCAPTCHA challenges on web pages when using Selenium
## pip install solvacaptcha
#### Tested against Windows 10 / Python 3.10 / Anaconda
```python
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"),
),
)
```
Raw data
{
"_id": null,
"home_page": "https://github.com/hansalemaos/solvacaptcha",
"name": "solvacaptcha",
"maintainer": "",
"docs_url": null,
"requires_python": "",
"maintainer_email": "",
"keywords": "reCAPTCHA",
"author": "Johannes Fischer",
"author_email": "aulasparticularesdealemaosp@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/a3/b8/0d5fb4f2480569aa2dd3c3ee9c971ef2ad144f15ea66e3289a0081446ff6/solvacaptcha-0.10.tar.gz",
"platform": null,
"description": "\r\n# automates the process of solving reCAPTCHA challenges on web pages when using Selenium\r\n\r\n## pip install solvacaptcha \r\n\r\n#### Tested against Windows 10 / Python 3.10 / Anaconda \r\n\r\n```python\r\n\r\nThis function automates the process of solving reCAPTCHA challenges on web pages.\r\nIt uses audio-based CAPTCHA challenges as an example and employs audio recording,\r\ntranscription, and interaction with web elements to solve the challenge.\r\nIt is recommended to install: Virtual Audio Cable (VAC) - the free version is more than enough\r\nhttps://vac.muzychenko.net/en/download.htm\r\n\r\nParameters:\r\n\tdriver: WebDriver\r\n\t\tThe Selenium WebDriver instance.\r\n\texpected_conditions: module\r\n\t\tThe module containing expected conditions for WebDriver waits.\r\n\tWebDriverWait: class\r\n\t\tThe class for setting up explicit waits with WebDriver.\r\n\tBy: class\r\n\t\tThe class for locating elements with WebDriver.\r\n\tffmpegexe: str\r\n\t\tThe path to the FFmpeg executable for audio processing.\r\n\tsleep_after_recording_started: int, optional\r\n\t\tTime to sleep (in seconds) after audio recording starts.\r\n\tsleep_after_each_click: int, optional\r\n\t\tTime to sleep (in seconds) after each interaction/click.\r\n\tcaptchatitle: str, optional\r\n\t\tThe CSS selector for identifying the CAPTCHA challenge element.\r\n\tlanguage: str, optional\r\n\t\tThe spoken language for audio transcription.\r\n\tcpus: int, optional\r\n\t\tNumber of CPU cores to use during audio processing.\r\n\tblas: bool, optional\r\n\t\tWhether to use BLAS acceleration for audio processing.\r\n\taudiodevice: int, optional\r\n\t\tIndex of the audio device for recording.\r\n\tsilent_seconds_stop: int, optional\r\n\t\tDuration of silence to stop audio recording (in seconds).\r\n\tsilence_threshold: int, optional\r\n\t\tThreshold for silence detection during audio recording.\r\n\tselector: tuple of tuples, optional\r\n\t\tCSS selectors for identifying various CAPTCHA interaction elements.\r\n\r\nReturns:\r\n\tNone\r\n\r\nNote:\r\n\tThis function automates solving a specific type of audio-based reCAPTCHA challenge. It records audio,\r\n\ttranscribes it to text, interacts with the CAPTCHA elements, and submits the solution.\r\n\r\nExample:\r\n\tfrom selenium.webdriver.support import expected_conditions\r\n\tfrom selenium.webdriver.support.wait import WebDriverWait\r\n\tfrom selenium.webdriver.common.by import By\r\n\tfrom operagxdriver import start_opera_driver\r\n\r\n\tfrom solvacaptcha import solva_captcha\r\n\r\n\tdriver = start_opera_driver(\r\n\t\topera_browser_exe=r\"C:\\Program Files\\Opera GX\\opera.exe\",\r\n\t\topera_driver_exe=r\"C:\\ProgramData\\anaconda3\\envs\\dfdir\\operadriver.exe\",\r\n\t\tuserdir=\"c:\\\\operabrowserprofile2\",\r\n\t\targuments=(\r\n\t\t\t\"--no-sandbox\",\r\n\t\t\t\"--test-type\",\r\n\t\t\t\"--no-default-browser-check\",\r\n\t\t\t\"--no-first-run\",\r\n\t\t\t\"--incognito\",\r\n\t\t\t\"--start-maximized\",\r\n\t\t),\r\n\t)\r\n\tdriver.get(\"https://www.google.com/recaptcha/api2/demo\")\r\n\r\n\tsolva_captcha(\r\n\t\tdriver,\r\n\t\texpected_conditions,\r\n\t\tWebDriverWait,\r\n\t\tBy,\r\n\t\tffmpegexe=r\"C:\\ffmpeg\\ffmpeg.exe\",\r\n\t\tsleep_after_recording_started=10,\r\n\t\tsleep_after_each_click=10,\r\n\t\tcaptchatitle='[title=\"reCAPTCHA\"]',\r\n\t\tlanguage=\"en\",\r\n\t\tcpus=5,\r\n\t\tblas=True,\r\n\t\taudiodevice=0,\r\n\t\tsilent_seconds_stop=3,\r\n\t\tsilence_threshold=-30,\r\n\t\tselector=(\r\n\t\t\t(\"button\", \"audio\", \"outerHTML\"),\r\n\t\t\t(\"button\", \">PLAY<\", \"outerHTML\"),\r\n\t\t\t(\"input\", 'id=\"audio-response\"', \"outerHTML\"),\r\n\t\t\t(\"button\", \">Verify<\", \"outerHTML\"),\r\n\t\t),\r\n\t)\r\n\r\n```\r\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "automates the process of solving reCAPTCHA challenges on web pages when using Selenium",
"version": "0.10",
"project_urls": {
"Homepage": "https://github.com/hansalemaos/solvacaptcha"
},
"split_keywords": [
"recaptcha"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "8aa96c1cccd434b6ea29c1947b2734c5afa931c3cf80df232ddd6c72e06dab49",
"md5": "5e3cb50d95b86e42b119b89b3ace8d20",
"sha256": "ad16e2c2fe128120eee5ffb449110de89175b707bd38d0c5d414e92e09d738de"
},
"downloads": -1,
"filename": "solvacaptcha-0.10-py3-none-any.whl",
"has_sig": false,
"md5_digest": "5e3cb50d95b86e42b119b89b3ace8d20",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 9472,
"upload_time": "2023-08-11T18:17:38",
"upload_time_iso_8601": "2023-08-11T18:17:38.240207Z",
"url": "https://files.pythonhosted.org/packages/8a/a9/6c1cccd434b6ea29c1947b2734c5afa931c3cf80df232ddd6c72e06dab49/solvacaptcha-0.10-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "a3b80d5fb4f2480569aa2dd3c3ee9c971ef2ad144f15ea66e3289a0081446ff6",
"md5": "d3b2338f93b0e1d3b4a9b5e85032cfe5",
"sha256": "420a573fcc5ae53005f9d46e90b50c19bca312588d331bab71cde0fbb7d75525"
},
"downloads": -1,
"filename": "solvacaptcha-0.10.tar.gz",
"has_sig": false,
"md5_digest": "d3b2338f93b0e1d3b4a9b5e85032cfe5",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 7611,
"upload_time": "2023-08-11T18:17:39",
"upload_time_iso_8601": "2023-08-11T18:17:39.542723Z",
"url": "https://files.pythonhosted.org/packages/a3/b8/0d5fb4f2480569aa2dd3c3ee9c971ef2ad144f15ea66e3289a0081446ff6/solvacaptcha-0.10.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-08-11 18:17:39",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "hansalemaos",
"github_project": "solvacaptcha",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"requirements": [
{
"name": "a_selenium_iframes_crawler",
"specs": []
},
{
"name": "audiotranser",
"specs": []
},
{
"name": "ffmpegaudiorecord",
"specs": []
},
{
"name": "kthread",
"specs": []
},
{
"name": "kthread_sleep",
"specs": []
},
{
"name": "touchtouch",
"specs": []
}
],
"lcname": "solvacaptcha"
}