CAPSOLVER
Blog
How to solve reCaptcha v2 using Puppeteer with Capsolver Extension

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

Logo of CapSolver

Ethan Collins

Pattern Recognition Specialist

23-Jul-2023

1. Installing puppeteer components

āš ļøIn this blog, will explain how to setup puppeteer js with capsolver extension for solve reCaptcha v2. But you can apply this for all the captchas.

Copy
npm i puppeteer puppeteer-extra puppeteer-extra-plugin-stealth

2. Setting up the extension

Download the archive with the extension, and unzip it to the folder ./CapSolver.Browser.Extension in the root of the project.

The extension has many settings, including automatic solution of the specified type of captcha, support for proxy, and other settings. The settings are available in the file ./assets/config.json.

These settings are:

json Copy
{
    "apiKey": "YourApiKey",
  "useCapsolver": true, Ex: true / false

  "useProxy": false, Ex: true / false
  "proxyType": "http", Ex: http / socks5 / socks4
  "hostOrIp": "", Ex: @google.com or 154.3.2.3
  "port": "", Ex: 8983
  "proxyLogin": "", Optional. Ex: dkkwje
  "proxyPassword": "", Optional. Ex: dkwjek

  "enabledForBlacklistControl": false, Ex: true / false
  "blackUrlList": [], 

  "enabledForRecaptcha": true, Ex: true / false
  "enabledForRecaptchaV3": true, Ex: true / false
  "enabledForcaptcha": true, Ex: true / false
  "enabledForcaptcha": true, Ex: true / false

  "reCaptchaMode": "token", Ex: click / token
  "captchaMode": "click",  Ex: click / token

  "reCaptchaDelayTime": 0,
  "captchaDelayTime": 0,

  "reCaptchaRepeatTimes": 10,
  "reCaptcha3RepeatTimes": 10,
  "captchaRepeatTimes": 10,
  "captchaRepeatTimes": 10
}

Enter your API key in the extension settings file ./assets/config.json. Your key must be written to the value of the apiKey field. You can see and copy you're API key on the page.

Example: apiKey: "CAP-4FDBD3SDFSD-23S-2-3"

In this example, we will use reCaptchaMode token, but we can use click, for reCaptcha it's recommended to use token mode.

3. Setting up Puppeter for solve reCaptcha with Capsolver Extension

Copy
const puppeteer = require('puppeteer-extra');
const StealthPlugin = require('puppeteer-extra-plugin-stealth');
const { executablePath } = require('puppeteer'); 

(async () => {
  const pathToExtension = require('path').join(__dirname, 'CapSolver.Browser.Extension');
  puppeteer.use(StealthPlugin())
  const browser = await puppeteer.launch({
    headless: false,
    args: [
      `--disable-extensions-except=${pathToExtension}`,
      `--load-extension=${pathToExtension}`,
    ],
    executablePath: executablePath()
  });
  
  const [page] = await browser.pages()
})();

Next, is opening the page https://www.google.com/recaptcha/api2/demo, and sending the captcha to capsolver.

Using page.goto() we go to the page https://www.google.com/recaptcha/api2/demo. Next, you need to send a captcha for a solution, this can be done manually or automatically.

In our example, we will send a captcha manually, for this we wait until the extension button with the CSS selector #recaptcha-anchor-label is available, then click on this button. After clicking on the button, the captcha will go to the service for a solution.

js Copy
await page.goto('https://site.example') 

// Waiting for the element with the CSS selector ".captcha-solver" to be available
await page.waitForSelector('#recaptcha-anchor-label')
// Click on the element with the specified selector
await page.click('#recaptcha-anchor-label')

Full Code:

js Copy
const puppeteer = require('puppeteer-extra');
const StealthPlugin = require('puppeteer-extra-plugin-stealth');
const { executablePath } = require('puppeteer'); 

(async () => {
  const pathToExtension = require('path').join(__dirname, 'CapSolver.Browser.Extension');
  puppeteer.use(StealthPlugin())
  const browser = await puppeteer.launch({
    headless: false,
    args: [
      `--disable-extensions-except=${pathToExtension}`,
      `--load-extension=${pathToExtension}`,
    ],
    executablePath: executablePath()
  });
  
  const [page] = await browser.pages()
  // Opening a page
await page.goto('https://site.example') 

// Waiting for the element with the CSS selector "#recaptcha-anchor-label" to be available
await page.waitForSelector('#recaptcha-anchor-label')
// Click on the element with the specified selector
await page.click('#recaptcha-anchor-label')
})();

And that is! You solved reCaptcha v2 using Capsolver Extension and Puppeteer. If you need to solve other captchas, you just need to replicate the tutorial for the other captchas.

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

The-Ultimate-CAPTCHA-Solver
Best Captcha Solver Extension, What Extension Service Solves Captcha Automatically?

Solve CAPTCHAs automatically with the CapSolver browser extension — the fastest, AI-powered CAPTCHA solver for Chrome

Extension
Logo of CapSolver

Sora Fujimoto

21-Oct-2025

Captcha Solver Extensions
Captcha Solver Extensions, How to Install Captcha Solver Extension

How to install and use the CapSolver browser extension — the best AI-powered CAPTCHA solver for Chrome and Firefox. Discover its benefits, automation integration, and easy setup guide for effortless CAPTCHA handling.

Extension
Logo of CapSolver

Lucas Mitchell

20-Oct-2025

reCAPTCHA-Auto-Solver
How to Solve reCAPTCHAs Automatically | the Best reCAPTCHA Auto Solver

Discover the ultimate reCAPTCHA Auto Solver. Learn how CapSolver's AI-powered Chrome Extension automates reCAPTCHA v2, v3 solving with high accuracy and efficiency. Boost your productivity today.

Extension
Logo of CapSolver

Ethan Collins

20-Oct-2025

Auto Captcha Solver Chrome
Auto Captcha Solver Chrome: CapSolver Auto Solver Extension Download

Looking for the best Chrome extension to automatically solve captchas? CapSolver Auto Solver Extension offers a fast, AI-powered way to bypass reCAPTCHA and other verification challenges.

Extension
Logo of CapSolver

Lucas Mitchell

18-Oct-2025

Auto CAPTCHA Solver
Auto CAPTCHA Solver, Best CAPTCHA Solver Extension

Learn how to install and use the CapSolver browser extension, the most efficient auto CAPTCHA solver for Chrome, Firefox, Puppeteer, and Selenium. Automate Captcha with AI-powered browser integration.

Extension
Logo of CapSolver

Sora Fujimoto

17-Oct-2025

Auto captcha solver on chrome: CapSolver
What is the Best Auto Captcha Solver on Chrome

CapSolver for Chrome automatically solves CAPTCHAs, saving time and providing a seamless browsing experience.

Extension
Logo of CapSolver

Lucas Mitchell

16-Oct-2025