🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more →
Socket
DemoInstallSign in
Socket

playwright-captcha-solver

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

playwright-captcha-solver

A lib for solving captchas using AI agents for playwright

1.0.8
latest
Source
npm
Version published
Weekly downloads
9
200%
Maintainers
1
Weekly downloads
 
Created
Source

Playwright Captcha Solver

A utility library that helps solve captchas in Playwright-automated browsers.

Status

⚠️ Early Development: This project is not currently ready for production use, but is working in simple captcha scenarios.

Installation

npm install playwright-captcha-solver
# or
yarn add playwright-captcha-solver

Dependencies

This library requires:

  • A Gemini API key for image recognition
  • Patchright - A modified version of Playwright that allows accessing closed shadow roots without being easily detected (unlike forcing them open in an init script, which can trigger anti-bot detection)

Usage

Basic example:

const { chromium } = require('patchright');
const { solveCaptchas } = require('playwright-captcha-solver');

async function run() {
    const browser = await chromium.launch();
    const page = await browser.newPage();
    
    await page.goto('https://website-with-captcha.com');
    
    // Solve any captchas on the page
    await solveCaptchas(page);
    
    // Continue with your automation...
    
    await browser.close();
}

run();

Configuration

.env

GEMINI_API_KEY=your_gemini_api_key

We are using Gemini currently because it is the cheapest option for image recognition and works well for simple captchas.

Contributing

Contributions are welcome! This project is in its early stages and could benefit from:

  • Additional captcha type support
  • Improved recognition accuracy
  • Better error handling
  • Documentation improvements

Please feel free to submit issues and pull requests.

License

MIT

FAQs

Package last updated on 31 Mar 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts