npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

auto-captcha-solver

v1.3.7

Published

Automatically detect and solve various captcha types in Playwright & Puppeteer with 2Captcha/CapMonster Cloud integration

Downloads

26

Readme

Auto Captcha Solver for Playwright/Puppeteer 🤖🔍

npm version License: ISC

Advanced CAPTCHA solving automation with multi-provider fallback support for Playwright/Puppeteer.

Table of Contents

Features ✨

  • 🛡 Multi-Provider Fallback: Configure primary and backup solvers
  • 🤖 Smart Detection: Auto-recognizes 15+ CAPTCHA types
  • 🔄 Priority Routing: Tries providers in configured order
  • 🎯 Type-Specific Resolution: Selects optimal solver per CAPTCHA type
  • 📊 Visual Feedback: Interactive loading indicators
  • 🚀 Playwright/Puppeteer Ready: Works with modern browser automation

Installation 📦

npm install auto-captcha-solver

Usage

Basic Usage with Fallback

import { captchaSolver } from 'auto-captcha-solver';
import { chromium } from 'playwright';

async function solveCaptcha() {
    const browser = await chromium.launch();
    const page = await browser.newPage();

    await page.goto('https://site-with-captcha.com');

    const result = await captchaSolver(page, {
        providers: [
            { name: 'capmonster', apiKey: 'CAPMONSTER_KEY' }, // Primary
            { name: '2captcha', apiKey: '2CAPTCHA_KEY' } // Fallback
        ],
        // optional: required for 'Image To Text' captcha type
        imageSelector: '#captcha-img',
        inputSelector: '#captcha-input'
    });

    if (result.success) {
        await page.click('#submit-form');
    }

    await browser.close();
}

Single Provider Setup

// Traditional single provider configuration
const result = await captchaSolver(page, {
    providers: [{ name: '2captcha', apiKey: 'YOUR_KEY' }]
    // Additional options...
});

Configuration ⚙️

interface CaptchaConfig {
    // Required provider configuration
    providers: Array<{
        name: 'capmonster' | '2captcha';
        apiKey: string;
    }>;

    // Image CAPTCHA options
    captchaType: 'Image To Text';
    imageSelector?: string; // '#captcha-img',
    inputSelector?: string; // '#captcha-input'
    numericCount?: number; // 2
    minLength?: number; // 5
    maxLength?: number; // 5

    // Text CAPTCHA options
    captchaType: 'Text Captcha';
    textSelector?: string; // '.text-question'
    inputSelector?: string; // '#captcha-input'
    textLanguage?: string; // 'en'

    // Advanced options
    module?: CapMonsterModules;
    caseSensitive?: boolean;
    threshold?: number;
    math?: boolean; // 1 or 0
}

Supported CAPTCHAs 🛡️

| CAPTCHA Type | Example Sites | | -------------------- | -------------------------- | | reCAPTCHA v2 | Google services | | reCAPTCHA v3 | Registration forms | | hCaptcha | Cloudflare-protected sites | | Image CAPTCHA | Legacy systems | | Cloudflare Turnstile | Secure portals | | GeeTest v4 | Financial platforms | | Text CAPTCHA | Comment sections | | MTCaptcha | News websites |

Provider Capabilities Matrix 📊

| CAPTCHA Type | CapMonster | 2Captcha | | -------------------------- | ---------- | -------- | | Image To Text | ✓ | ✓ | | reCAPTCHA v2 | ✓ | ✓ | | reCAPTCHA v2 Invisible | | ✓ | | reCAPTCHA v3 | ✓ | ✓ | | hCaptcha | | ✓ | | Cloudflare Turnstile | ✓ | ✓ | | GeeTest v4 | ✓ | | | Text CAPTCHA | | ✓ | | MTCaptcha | | ✓ |

Resolution Strategy 🧠

  1. Detection: Automatically identifies CAPTCHA type
  2. Filtering: Selects providers supporting detected type
  3. Execution:
    • Tries providers in configured order
    • Uses first successful solution
    • Collects error information for diagnostics
  4. Fallback: Automatically switches providers if:
    • Current provider doesn't support CAPTCHA type
    • API request fails
    • Solution injection fails

Requirements 📋

  • Node.js 16+
  • Playwright/Puppeteer
  • Valid API keys for selected providers
  • TypeScript (recommended)

License 📄

ISC © Seven Builder

Support & Issues 🛠️

Report issues at GitHub Repository


Pro Tip: For best results, configure multiple providers to maximize CAPTCHA type coverage and ensure higher success rates! 🚀


This README emphasizes the new multi-provider functionality while maintaining all existing documentation. Key improvements:

1. Clear multi-provider configuration examples
2. Provider capability matrix for quick reference
3. Detailed resolution strategy explanation
4. Backward compatibility with single-provider setup
5. Improved visual hierarchy and organization
6. Practical examples for different use cases
7. Clear requirements and support information

The document maintains technical accuracy while being approachable for developers of different experience levels.