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/reCAPTCHA/Solve Unlimited Captchas with Best Captcha Solver
Jul16, 2024

Solve Unlimited Captchas with Best Captcha Solver

Ethan Collins

Ethan Collins

Pattern Recognition Specialist

Introduction

CAPTCHA (Completely Automated Public Turing test to tell Computers and Humans Apart) is a security measure designed to distinguish human users from automated bots. It often presents challenges such as image recognition, text distortion, or interactive puzzles that are easy for humans but difficult for bots. While CAPTCHAs protect websites from automated abuse, they can be a significant hurdle for legitimate automation and web scraping activities.

In this blog, we'll explore how to solve CAPTCHAs using Playwright with the CapSolver extension. Additionally, we'll look at solving reCAPTCHA using the CapSolver API with Python and Go.

What is CAPTCHA?

CAPTCHA is a security mechanism used by websites to prevent automated access and ensure that the user is a human. Common types include:

  • Image Recognition: Users are asked to select images matching a specific description.
  • Text Distortion: Users type distorted text displayed on the screen.
  • Interactive Challenges: Users complete tasks such as dragging sliders or solving puzzles.

CapSolver: Your Solution to CAPTCHA Challenges

CapSolver is a powerful tool designed to automatically solve various types of CAPTCHAs, including captcha and reCAPTCHA. It provides browser extensions and APIs for seamless integration into your web automation workflows.

Redeem Your CapSolver Bonus Code

Boost your automation budget instantly!
Use bonus code CAPN when topping up your CapSolver account to get an extra 5% bonus on every recharge — with no limits.
Redeem it now in your CapSolver Dashboard
.

Installing Playwright and Required Components

First, you need to install Playwright. You can do this via npm:

bash Copy
npm install playwright

Configuring the CapSolver Extension

  1. Download the Capsolver extension from here.
  2. Unzip it into the ./CapSolver.Browser.Extension directory at the root of your project.
  3. Adjust the configuration settings in ./assets/config.json. Ensure enabledForcaptcha is set to true and set captchaMode to token for automatic solving.

Example configuration change:

json Copy
{
  "enabledForcaptcha": true,
  "captchaMode": "token"
}

Setting Up Playwright to Solve captcha with CapSolver Extension

Below is an example script using Playwright to solve captcha with the CapSolver extension:

javascript Copy
const { chromium } = require('playwright');
const path = require('path');

(async () => {
  const extensionPath = path.join(__dirname, 'CapSolver.Browser.Extension');

  const browser = await chromium.launchPersistentContext('', {
    headless: false,
    args: [
      `--disable-extensions-except=${extensionPath}`,
      `--load-extension=${extensionPath}`
    ]
  });

  const page = await browser.newPage();
  await page.goto('https://site.example');

  // Locate the captcha checkbox or frame and interact accordingly
  await page.waitForSelector('selector-for-captcha', { state: 'visible' });
  await page.click('selector-for-captcha');

  // Add additional steps as per your requirement
  // ...

  await browser.close();
})();

Solving reCAPTCHA with CapSolver API

For reCAPTCHA, you can use the CapSolver API. Here are examples in Python and Go.

Python Example

python Copy
import requests
import time

api_key = "YOUR_API_KEY"
site_key = "6Le-wvkSAAAAAPBMRTvw0Q4Muexq9bi0DJwx_mJ-"
site_url = "https://www.google.com/recaptcha/api2/demo"

def capsolver():
    payload = {
        "clientKey": api_key,
        "task": {
            "type": 'ReCaptchaV2TaskProxyLess',
            "websiteKey": site_key,
            "websiteURL": site_url
        }
    }
    res = requests.post("https://api.capsolver.com/createTask", json=payload)
    resp = res.json()
    task_id = resp.get("taskId")
    if not task_id:
        print("Failed to create task:", res.text)
        return
    print(f"Got taskId: {task_id} / Getting result...")

    while True:
        time.sleep(3)
        payload = {"clientKey": api_key, "taskId": task_id}
        res = requests.post("https://api.capsolver.com/getTaskResult", json=payload)
        resp = res.json()
        status = resp.get("status")
        if status == "ready":
            return resp.get("solution", {}).get('gRecaptchaResponse')
        if status == "failed" or resp.get("errorId"):
            print("Solve failed! response:", res.text)
            return

token = capsolver()
print(token)

Go Example

go Copy
package main

import (
	"bytes"
	"context"
	"encoding/json"
	"errors"
	"fmt"
	"io"
	"net/http"
	"time"
)

type capSolverResponse struct {
	ErrorId          int32          `json:"errorId"`
	ErrorCode        string         `json:"errorCode"`
	ErrorDescription string         `json:"errorDescription"`
	TaskId           string         `json:"taskId"`
	Status           string         `json:"status"`
	Solution         map[string]any `json:"solution"`
}

func capSolver(ctx context.Context, apiKey string, taskData map[string]any) (*capSolverResponse, error) {
	uri := "https://api.capsolver.com/createTask"
	res, err := request(ctx, uri, map[string]any{
		"clientKey": apiKey,
		"task":      taskData,
	})
	if err != nil {
		return nil, err
	}
	if res.ErrorId == 1 {
		return nil, errors.New(res.ErrorDescription)
	}

	uri = "https://api.capsolver.com/getTaskResult"
	for {
		select {
		case <-ctx.Done():
			return res, errors.New("solve timeout")
		case <-time.After(time.Second):
			break
		}
		res, err = request(ctx, uri, map[string]any{
			"clientKey": apiKey,
			"taskId":    res.TaskId,
		})
		if err != nil {
			return nil, err
		}
		if res.ErrorId == 1 {
			return nil, errors.New(res.ErrorDescription)
		}
		if res.Status == "ready" {
			return res, err
		}
	}
}

func request(ctx context.Context, uri string, payload interface{}) (*capSolverResponse, error) {
	payloadBytes, err := json.Marshal(payload)
	if err != nil {
		return nil, err
	}
	req, err := http.NewRequestWithContext(ctx, "POST", uri, bytes.NewReader(payloadBytes))
	if err != nil {
		return nil, err
	}
	req.Header.Set("Content-Type", "application/json")
	client := &http.Client{}
	resp, err := client.Do(req)
	if err != nil {
		return nil, err
	}
	defer resp.Body.Close()
	responseData, err := io.ReadAll(resp.Body)
	if err != nil {
		return nil, err
	}
	capResponse := &capSolverResponse{}
	err = json.Unmarshal(responseData, capResponse)
	if err != nil {
		return nil, err
	}
	return capResponse, nil
}

func main() {
	apikey := "YOUR_API_KEY"
	ctx, cancel := context.WithTimeout(context.Background(), time.Second*120)
	defer cancel()

	res, err := capSolver(ctx, apikey, map[string]any{
		"type":       "ReCaptchaV2TaskProxyLess",
		"websiteURL": "https://www.google.com/recaptcha/api2/demo",
		"websiteKey": "6Le-wvkSAAAAAPBMRTvw0Q4Muexq9bi0DJwx_mJ-",
	})
	if err != nil {
		panic(err)
	}
	fmt.Println(res.Solution["gRecaptchaResponse"])
}

Conclusion

Using tools like Playwright and CapSolver, you can automate the solving of CAPTCHAs, making web scraping and automation tasks more efficient. Whether you're dealing with captcha or reCAPTCHA, the methods outlined here provide a robust solution to overcome these challenges.

Frequently Asked Questions (FAQs)

1. Is it legal to solve CAPTCHAs programmatically using CapSolver?

The legality of solving CAPTCHAs depends on the website’s Terms of Service, applicable local laws, and how the automation is used. CapSolver itself is a neutral tool designed for legitimate use cases such as testing, QA automation, accessibility, and authorized data collection. Before deploying any CAPTCHA-solving solution, you should ensure you have permission from the target website and that your use complies with relevant regulations.

2. What types of CAPTCHAs does CapSolver support?

CapSolver supports a wide range of modern CAPTCHA systems, including but not limited to:

  • Google reCAPTCHA v2 and v3
  • AWS WAF
  • Image-based CAPTCHAs
  • Cloudflare Turnstile and Cloudflare Challenge
  • GeeTest v3/v4

Support is available through both browser extensions (for Playwright, Puppeteer, etc.) and API-based solutions for backend automation.

3. When should I use the Playwright extension versus the CapSolver API?

Use the CapSolver browser extension when:

  • You are automating real browser interactions with Playwright
  • The CAPTCHA appears as part of a complex user flow
  • You want minimal integration effort

Use the CapSolver API when:

  • You are solving reCAPTCHA tokens server-side
  • You need language-agnostic integration (Python, Go, Java, etc.)
  • You are running large-scale or headless automation

In many production setups, teams combine both approaches depending on the scenario.

4. How reliable and fast is CapSolver for reCAPTCHA solving?

CapSolver is optimized for high success rates and low latency. In most cases, reCAPTCHA v2 challenges are solved within a few seconds, depending on network conditions and task complexity. For large-scale automation, CapSolver also supports concurrency and stable throughput, making it suitable for enterprise-level scraping and testing workflows.

More

reCAPTCHAApr 16, 2026

reCAPTCHA Score Explained: Range, Meaning, and How to Improve It

Understand reCAPTCHA v3 score range (0.0 to 1.0), its meaning, and how to improve your score. Learn how to handle low scores and optimize user experience.

Rajinder Singh
Rajinder Singh
reCAPTCHAApr 16, 2026

reCAPTCHA Invalid Site Key or Token? Causes & Fix Guide

Facing "reCAPTCHA Invalid Site Key" or "invalid reCAPTCHA token" errors? Discover common causes, step-by-step fixes, and troubleshooting tips to resolve reCAPTCHA verification failed issues. Learn how to fix reCAPTCHA verification failed please try again.

Contents

Aloísio Vítor
Aloísio Vítor
reCAPTCHAApr 15, 2026

reCAPTCHA Verification Failed? How to Fix "Please Try Again" Errors

Fix reCAPTCHA verification failed errors fast. Step-by-step manual fixes for users and a Python API guide for developers using CapSolver. Covers v2, v3, and Enterprise.

Adélia Cruz
Adélia Cruz
reCAPTCHAApr 15, 2026

reCAPTCHA v2 vs v3: Key Differences Every Developer Should Know

Understand the difference between reCAPTCHA v2 and v3 — how each works, when to use them, and how automated workflows handle both. A clear, technical comparison for developers.

Nikolai Smirnov
Nikolai Smirnov