Skip to content

A library to solve hcaptcha challenges that are automated within Playwright. You can automatically set response values where they should be so the only thing left for you is submitting the page or you can get the response token.

Notifications You must be signed in to change notification settings

xrip/playwright-hcaptcha-solver

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

74 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

hCaptcha solver for Playwright written in Typescript

A library to solve hcaptcha challenges that are automated within Playwright. You can automatically set response values where they should be so the only thing left for you is submitting the page or you can get the response token. Average response time is rougly 13 - 20 seconds with TensorFlow's Image Recognition.

Best results with Playwright-stealth

If you like this project feel free to donate!

Donate with PayPal

Install

yarn add https://github.com/xrip/playwright-hcaptcha-solver.git

Usage

await solveCaptcha(page);
  • page <Page> - Playwright Page Instance

Automatically set respone value

import { chromium } from 'playwright';
import { solveCaptcha } from 'playwright-hcaptcha-solver';

(async () => {

    const browser = await chromium.launch({
        headless: false,
        args: [
            '--disable-blink-features=AutomationControlled',
        ],

    });

    const ctx = await browser.newContext();
    await ctx.addInitScript(() => {

    });
    const page = await ctx.newPage();

    await page.goto('http://democaptcha.com/demo-form-eng/hcaptcha.html');

    await solveCaptcha(page);

    await Promise.all([
        page.waitForNavigation(),
        page.click('input[type="submit"]'),
    ]);

    const h2 = await page.waitForSelector('h2')
    console.log(`Done. Result: "${await h2.textContent()}"`);

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

Credits

About

A library to solve hcaptcha challenges that are automated within Playwright. You can automatically set response values where they should be so the only thing left for you is submitting the page or you can get the response token.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Languages

  • TypeScript 100.0%