{"id":15198898,"url":"https://github.com/erizoat/recaptcha-selenium","last_synced_at":"2025-10-05T15:11:41.744Z","repository":{"id":255285370,"uuid":"849118800","full_name":"ERIZOAT/recaptcha-selenium","owner":"ERIZOAT","description":null,"archived":false,"fork":false,"pushed_at":"2024-08-29T02:44:25.000Z","size":9,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-14T00:28:15.774Z","etag":null,"topics":["extension","extension-chrome","machine-learning","recaptcha","recaptcha-solver","recaptcha-v2","recaptcha-v3","selenium","selenium-java","selenium-python","selenium-webdriver","solving-recaptcha-service"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ERIZOAT.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-08-29T02:30:47.000Z","updated_at":"2024-08-29T02:46:40.000Z","dependencies_parsed_at":"2024-08-29T03:54:36.349Z","dependency_job_id":null,"html_url":"https://github.com/ERIZOAT/recaptcha-selenium","commit_stats":null,"previous_names":["erizoat/recaptcha-selenium"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ERIZOAT%2Frecaptcha-selenium","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ERIZOAT%2Frecaptcha-selenium/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ERIZOAT%2Frecaptcha-selenium/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ERIZOAT%2Frecaptcha-selenium/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ERIZOAT","download_url":"https://codeload.github.com/ERIZOAT/recaptcha-selenium/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241678128,"owners_count":20001679,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["extension","extension-chrome","machine-learning","recaptcha","recaptcha-solver","recaptcha-v2","recaptcha-v3","selenium","selenium-java","selenium-python","selenium-webdriver","solving-recaptcha-service"],"created_at":"2024-09-28T02:00:20.822Z","updated_at":"2025-10-05T15:11:36.714Z","avatar_url":"https://github.com/ERIZOAT.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Solving reCaptcha Using Selenium and CapSolver Extension\n\nThis guide walks you through the process of setting up Selenium with the [CapSolver extension](https://www.capsolver.com/?utm_source=github\u0026utm_medium=repo\u0026utm_campaign=recaptchaextension) to solve reCaptcha v2. The method described can also be adapted to handle other types of CAPTCHAs.\n\n## Table of Contents\n\n- [1. Installing Selenium and Required Components](#1-installing-selenium-and-required-components)\n- [2. Configuring the CapSolver Extension](#2-configuring-the-capsolver-extension)\n- [3. Setting Up Selenium to Solve reCaptcha with CapSolver Extension](#3-setting-up-selenium-to-solve-recaptcha-with-capsolver-extension)\n- [4. Full Code Example](#4-full-code-example)\n\n## 1. Installing Selenium and Required Components\n\nFirst, install Selenium and the necessary components using pip:\n\n```bash\npip install selenium\n```\n\nMake sure to download and set up the appropriate drivers for the browser you plan to use (e.g., [ChromeDriver](https://sites.google.com/chromium.org/driver/) for Google Chrome, [GeckoDriver](https://github.com/mozilla/geckodriver/releases) for Firefox).\n\n## 2. Configuring the CapSolver Extension\n\nDownload the [CapSolver extension](https://github.com/capsolver/capsolver-browser-extension/releases/) and unzip it into a directory named `./CapSolver.Browser.Extension` at the root of your project.\n\n### Configuration Settings\n\nThe extension provides various settings, including automatic CAPTCHA solving and proxy support. These are defined in the `./assets/config.json` file. Below is an example configuration:\n\n```json\n{\n  \"apiKey\": \"YourApiKey\",\n  \"useCapsolver\": true,\n  \"useProxy\": false,\n  \"proxyType\": \"http\",\n  \"hostOrIp\": \"\",\n  \"port\": \"\",\n  \"proxyLogin\": \"\",\n  \"proxyPassword\": \"\",\n  \"enabledForBlacklistControl\": false,\n  \"blackUrlList\": [],\n  \"enabledForRecaptcha\": true,\n  \"enabledForRecaptchaV3\": true,\n  \"enabledForHCaptcha\": true,\n  \"enabledForFunCaptcha\": true,\n  \"reCaptchaMode\": \"token\",\n  \"hCaptchaMode\": \"click\",\n  \"reCaptchaDelayTime\": 0,\n  \"hCaptchaDelayTime\": 0,\n  \"reCaptchaRepeatTimes\": 10,\n  \"reCaptcha3RepeatTimes\": 10,\n  \"hCaptchaRepeatTimes\": 10,\n  \"funCaptchaRepeatTimes\": 10\n}\n```\n\n- **API Key**: Insert your CapSolver API key in the `apiKey` field. You can obtain your API key from the [CapSolver Dashboard](https://www.capsolver.com/?utm_source=github\u0026utm_medium=repo\u0026utm_campaign=recaptchaextension).\n- **Modes**: For this example, `reCaptchaMode` is set to `token`, but you can also use the `click` mode for reCaptcha.\n\nFor detailed documentation on CapSolver's features, visit the [CapSolver Documentation](https://docs.capsolver.com/en/guide/getting-started/?utm_source=github\u0026utm_medium=repo\u0026utm_campaign=recaptchaextension).\n\n## 3. Setting Up Selenium to Solve reCaptcha with CapSolver Extension\n\nNow, let's set up Selenium WebDriver and configure it to use the CapSolver extension. Below is an example using ChromeDriver in Python:\n\n```python\nfrom selenium import webdriver\nfrom selenium.webdriver.chrome.options import Options\nfrom selenium.webdriver.common.by import By\nfrom selenium.webdriver.support.ui import WebDriverWait\nfrom selenium.webdriver.support import expected_conditions as EC\nimport os\n\ndef main():\n    extension_path = os.path.abspath('./CapSolver.Browser.Extension')\n    chrome_options = Options()\n    chrome_options.add_argument(f'--load-extension={extension_path}')\n\n    driver = webdriver.Chrome(options=chrome_options)\n    driver.get('https://www.google.com/recaptcha/api2/demo')\n\n    # Wait for the captcha to be solved automatically by the extension\n    WebDriverWait(driver, 10).until(EC.element_to_be_clickable((By.ID, 'recaptcha-demo-submit')))\n\n    # Proceed with form submission or any other actions post-captcha solving\n    driver.quit()\n\nif __name__ == \"__main__\":\n    main()\n```\n\n## 4. Full Code Example\n\nThe Python script provided above is ready to run. Ensure your environment is correctly set up with the necessary packages and drivers, and adjust the `extension_path` if needed to point to your CapSolver extension directory.\n\nBy following these steps, you've successfully configured Selenium with the CapSolver Extension to solve reCaptcha v2 using Python. This method can be easily adapted to solve other types of CAPTCHAs by making minor adjustments.\n\nFor more information on CapSolver, check out the [CapSolver Documentation](https://docs.capsolver.com/en/guide/getting-started/?utm_source=github\u0026utm_medium=repo\u0026utm_campaign=recaptchaextension) or visit the [CapSolver Website](https://www.capsolver.com/?utm_source=github\u0026utm_medium=repo\u0026utm_campaign=recaptchaextension).\n\n\n\u003cimg width=\"960\" alt=\"CapSolver\" src=\"https://github.com/user-attachments/assets/fd9449e8-a6c4-4ec3-8bd7-8d6e107f1134\"\u003e\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ferizoat%2Frecaptcha-selenium","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ferizoat%2Frecaptcha-selenium","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ferizoat%2Frecaptcha-selenium/lists"}