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 Puppeteer [Javascript] with CapSolver Extension
Jul23, 2023

How to Solve reCAPTCHA v2 using Puppeteer [Javascript] with CapSolver Extension

Ethan Collins

Ethan Collins

Pattern Recognition Specialist

Introduction

Automating browser interactions often requires handling CAPTCHA challenges, especially when working with tools like Puppeteer. In this guide, we will walk through how to set up Puppeteer JS with the CapSolver browser extension to solve reCAPTCHA v2 efficiently. While this tutorial focuses on reCAPTCHA v2, the same approach can be extended to other CAPTCHA types supported by CapSolver.

By the end of this article, you will understand how to install the required dependencies, configure the CapSolver extension, and trigger CAPTCHA solving directly within a Puppeteer-controlled browser session.

1. Installing puppeteer components

⚠️ In this blog, we will explain how to set up Puppeteer JS with the CapSolver extension to solve reCAPTCHA v2. However, this approach can be applied to other CAPTCHA types as well.

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 CAPTCHA solving, proxy support, and fine-grained control options. These settings are available in the file ./assets/config.json.

These settings are:

json Copy
{
    "apiKey": "YourApiKey",
    "useCapsolver": true,

    "useProxy": false,
    "proxyType": "http",
    "hostOrIp": "",
    "port": "",
    "proxyLogin": "",
    "proxyPassword": "",

    "enabledForBlacklistControl": false,
    "blackUrlList": [],

    "enabledForRecaptcha": true,
    "enabledForRecaptchaV3": true,
    "enabledForcaptcha": true,

    "reCaptchaMode": "token",
    "captchaMode": "click",

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

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

Enter your API key in the extension settings file ./assets/config.json. The key must be assigned to the apiKey field. You can copy your API key directly from the CapSolver dashboard.

Example:

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

In this example, reCaptchaMode is set to token. While click mode is also available, token mode is generally recommended for reCAPTCHA.

3. Setting up Puppeteer to 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, open the page https://www.google.com/recaptcha/api2/demo and send the CAPTCHA to CapSolver.

Using page.goto(), navigate to the target page. The CAPTCHA can be sent for solving either automatically or manually.
In this example, we trigger it manually by waiting for the CAPTCHA checkbox and clicking it.

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

// Waiting for the element with the CSS selector "#recaptcha-anchor-label"
await page.waitForSelector('#recaptcha-anchor-label')
// Click on the element
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"
  await page.waitForSelector('#recaptcha-anchor-label')
  // Click on the element
  await page.click('#recaptcha-anchor-label')
})();

Conclusion

You have successfully solved reCAPTCHA v2 using Puppeteer and the CapSolver browser extension. This setup provides a flexible and scalable way to handle CAPTCHA challenges directly within a real browser environment. By adjusting the extension configuration, the same workflow can be reused for other CAPTCHA types supported by CapSolver, making it suitable for testing, automation, and large-scale browser-based tasks.

Frequently Asked Questions (FAQs)

1. Can this method be used in headless mode?
The CapSolver browser extension requires a visible browser environment. For this reason, headless: false is recommended when using the extension-based approach.

2. Does this setup work for CAPTCHA types other than reCAPTCHA v2?
Yes. The CapSolver extension supports multiple CAPTCHA types. You can enable or disable specific CAPTCHA solvers in the config.json file and adapt the workflow accordingly.

3. Is a proxy required when using the CapSolver extension?
A proxy is optional. The extension supports proxy configuration, but many use cases work without one. Proxy usage depends on your target website and automation requirements.

4. What is the difference between token and click modes for reCAPTCHA?
Token mode retrieves the CAPTCHA solution programmatically and is generally more stable for automation. Click mode simulates user interaction with the CAPTCHA checkbox.

5. Can this setup be used in production environments?
Yes. With proper configuration, error handling, and scaling considerations, this approach can be integrated into production-grade browser automation workflows.

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