ProductsIntegrationsResourcesDocumentationPricing
Start Now

© 2026 CapSolver. All rights reserved.

CONTACT US

Slack: lola@capsolver.com

Products

  • reCAPTCHA v2
  • reCAPTCHA v3
  • Cloudflare Turnstile
  • Cloudflare Challenge
  • AWS WAF
  • Browser Extension
  • Many more CAPTCHA types

Integrations

  • Selenium
  • Playwright
  • Puppeteer
  • n8n
  • Partners
  • View All Integrations

Resources

  • Referral System
  • Documentation
  • API Reference
  • Blog
  • FAQs
  • Glossary
  • Status

Legal

  • Terms & Conditions
  • Privacy Policy
  • Refund Policy
  • Don't Sell My Info
Blog/Extension/How to solve reCaptcha v2 using Selenium [Javascript] with Capsolver Extension
Nov22, 2023

How to solve reCaptcha v2 using Selenium [Javascript] with Capsolver Extension

Lucas Mitchell

Lucas Mitchell

Automation Engineer

reCaptcha solver selenium

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 npm:

Copy
npm install selenium-webdriver

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 Copy
{
  "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:

javascript Copy
const { Builder } = require('selenium-webdriver');
const chrome = require('selenium-webdriver/chrome');
const path = require('path');

(async function solveCaptcha() {
  let options = new chrome.Options();
  options.addArguments(`--load-extension=${path.join(__dirname, 'CapSolver.Browser.Extension')}`);

  let driver = await new Builder()
    .forBrowser('chrome')
    .setChromeOptions(options)
    .build();

  try {
    // Navigate to the page with reCaptcha
    await driver.get('https://www.google.com/recaptcha/api2/demo');

    // Wait for the captcha solver button and click it
    await driver.wait(until.elementLocated(By.css('#recaptcha-anchor-label')), 10000);
    await driver.findElement(By.css('#recaptcha-anchor-label')).click();

    // Add additional steps as per your requirement

  } finally {
    await driver.quit();
  }
})();

Full Code:

javascript Copy
const { Builder, By, until } = require('selenium-webdriver');
const chrome = require('selenium-webdriver/chrome');
const path = require('path');

(async function solveCaptcha() {
  let options = new chrome.Options();
  options.addArguments(`--load-extension=${path.join(__dirname, 'CapSolver.Browser.Extension')}`);

  let driver = await new Builder()
    .forBrowser('chrome')
    .setChromeOptions(options)
    .build();

  try {
    await driver.get('https://site.example');
    await driver.wait(until.elementLocated(By.css('#recaptcha-anchor-label')), 10000);
    await driver.findElement(By.css('#recaptcha-anchor-label')).click();
  } finally {
    await driver.quit();
  }
})();

And that's it! You have successfully solved reCaptcha v2 using the Capsolver Extension and Selenium. To solve other types of captchas, simply follow the same steps and adjust accordingly.

Capsolver Team 💜

More

ExtensionApr 08, 2026

Browser Extension for Automatic CAPTCHA Solving: How to Use It Efficiently

Learn how to set up a browser extension for automatic CAPTCHA solving. Boost your web automation efficiency with step-by-step instructions and code examples.

Adélia Cruz
Adélia Cruz
ExtensionJan 12, 2026

Best CAPTCHA Solver Chrome Extension in 2026: Compared & Ranked

Discover the best CAPTCHA solver Chrome extension in 2026. Compare top tools like CapSolver and AZcaptcha for speed, accuracy, and AI-powered bypass of reCAPTCHA and Cloudflare.

Contents

Sora Fujimoto
Sora Fujimoto
ExtensionAug 30, 2023

CapSolver Extension: Effortlessly Solve Image Captcha and ImageToText Challenges in Your Browser

Use the CapSolver Chrome Extension for AI-powered, one-click solving of Image Captcha and ImageToText challenges directly in your browser.

Lucas Mitchell
Lucas Mitchell
ExtensionNov 29, 2023

How to Solve AWS Captcha Using Puppeteer [Javascript] with CapSolver Extension

Learn to seamlessly solve AWS Captcha with Puppeteer and Capsolver Extension, a detailed guide on setting up and automating captcha solutions effectively

Ethan Collins
Ethan Collins