How to solve reCaptcha using Selenium [Python] with Capsolver Extension

Lucas Mitchell
Automation Engineer
26-Mar-2024

Solving reCaptcha Using Selenium and Capsolver Extension
In this blog, we'll guide you through the process of setting up Selenium with the Capsolver extension to solve reCaptcha v2. This method can also be applied to other types of captchas.
1. Installing Selenium and Required Components
First, you need to install Selenium and other necessary components. You can do this using pip:
pip install selenium
Make sure you have the appropriate drivers for the browser you intend to use (e.g., ChromeDriver for Google Chrome, GeckoDriver for Firefox).
2. Configuring the Capsolver Extension
Download the Capsolver extension from here. Unzip it into the ./CapSolver.Browser.Extension directory at the root of your project.
The extension offers various settings, including automatic captcha solving, proxy support, and more. These settings are located in ./assets/config.json. Here's an example of the configuration:
json
{
"apiKey": "YourApiKey",
"useCapsolver": true,
"useProxy": false,
"proxyType": "http",
"hostOrIp": "",
"port": "",
"proxyLogin": "",
"proxyPassword": "",
"enabledForBlacklistControl": false,
"blackUrlList": [],
"enabledForRecaptcha": true,
"enabledForRecaptchaV3": true,
"enabledForcaptcha": true,
"enabledForcaptcha": true,
"reCaptchaMode": "token",
"captchaMode": "click",
"reCaptchaDelayTime": 0,
"captchaDelayTime": 0,
"reCaptchaRepeatTimes": 10,
"reCaptcha3RepeatTimes": 10,
"captchaRepeatTimes": 10,
"captchaRepeatTimes": 10
}
Insert your API key in the apiKey field in ./assets/config.json. You can find your API key on the Capsolver page.
For this example, we'll use the reCaptchaMode set to token, but you can also use click mode for reCaptcha.
3. Setting Up Selenium to Solve reCaptcha with Capsolver Extension
First, you need to set up Selenium WebDriver and configure it to use the Capsolver extension. Here's an example using ChromeDriver in Python:
python
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
import os
def main():
extension_path = os.path.abspath('./CapSolver.Browser.Extension')
chrome_options = Options()
chrome_options.add_argument(f'--load-extension={extension_path}')
driver = webdriver.Chrome(options=chrome_options)
driver.get('https://www.google.com/recaptcha/api2/demo')
# Wait for the captcha to be solved automatically by the extension
WebDriverWait(driver, 10).until(EC.element_to_be_clickable((By.ID, 'recaptcha-demo-submit')))
# Here, you can proceed with your form submission or any other actions post-captcha solving
driver.quit()
if __name__ == "__main__":
main()
Full Code:
The provided Python script is complete and ready to run. Ensure you've correctly set up your environment with the required packages and drivers, and don't forget to adjust the extension_path as necessary to point to your Capsolver extension directory.
And that's it! You have successfully solved reCaptcha v2 using the Capsolver Extension and Selenium in Python. To solve other types of captchas, simply follow the same steps and adjust accordingly.
Capsolver Team 💜
Compliance Disclaimer: The information provided on this blog is for informational purposes only. CapSolver is committed to compliance with all applicable laws and regulations. The use of the CapSolver network for illegal, fraudulent, or abusive activities is strictly prohibited and will be investigated. Our captcha-solving solutions enhance user experience while ensuring 100% compliance in helping solve captcha difficulties during public data crawling. We encourage responsible use of our services. For more information, please visit our Terms of Service and Privacy Policy.
More

How to Identify and Obtain reCAPTCHA “s” Parameter Data
Learn to identify and obtain reCaptcha 's' data for effective captcha solving. Follow our step-by-step guide on using Capsolver's tools and techniques.

Ethan Collins
25-Nov-2025

How to Identify and Submit reCAPTCHA Extra Parameters (v2/v3/Enterprise) | CapSolver Guide
Learn how to detect and submit extra reCAPTCHA parameters using CapSolver to improve accuracy and solve complex challenges.

Rajinder Singh
10-Nov-2025

How to Solve reCAPTCHA When Scraping Search Results with Puppeteer
Master the art of Puppeteer web scraping by learning how to reliably solve reCAPTCHA v2 and v3. Discover the best puppeteer recaptcha solver techniques for large-scale data harvesting and SEO automation.

Lucas Mitchell
04-Nov-2025

AI Powered SEO Automation: How to Solve Captcha for Smarter SERP Data Collection
Discover how AI Powered SEO Automation overcomes CAPTCHA challenges for smarter SERP data collection and learn about reCAPTCHA v2/v3 solutions

Emma Foster
23-Oct-2025

reCAPTCHA Solver Auto Recognition and Solve Methods
Learn how to automatically recognize and solve Google reCAPTCHA v2, v3, invisible, and enterprise challenges using advanced AI and OCR techniques

Sora Fujimoto
22-Oct-2025

How to Solve reCAPTCHA v2: Solve reCAPTCHA v2 Guide
Learn how to automate solving Google reCAPTCHA v2 using CapSolver. Discover API and SDK integration, step-by-step guides, and bonus codes to streamline captcha solving for web scraping, automation, and development projects.

Aloísio Vítor
21-Oct-2025

