New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

puppeteer-extra-plugin-captchaai

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
Package was removed
Sorry, it seems this package was removed from the registry

puppeteer-extra-plugin-captchaai

A puppeteer-extra plugin to interact/solve with API.

1.0.1
unpublished
latest
Source
npm
Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

puppeteer-extra-plugin-captchaai

  • Manage to solve captcha challenges with AI (captcha service based).
  • Puppeteer browser context.
  • ❗ An API key it's required. Get here.

⬇️ Install

npm i puppeteer puppeteer-extra puppeteer-extra-plugin-captchaai

✋ Usage

  • Import and use within puppeteer-extra.

     const puppeteer = require('puppeteer-extra');
     const CaptchaaiPlugin = require('puppeteer-extra-plugin-captchaai')();
     
     puppeteer.use(CaptchaaiPlugin);
    
  • .setHandler('apikey', verbose) - at the top of your script.

Set your apikey in order to request solving tasks.

 CaptchaaiPlugin.setHandler('CAI-XXX...', 1); // debug tasks: 1 or 2

📖 Handler / Solving API Wrapper

  • Handler it's based on captchaai-npm (nodejs api wrapper for captchaai.io api).

  • Retrieve the currently handler:

const handler = CaptchaaiPlugin.handler()

example: retrieve handler and call for funcaptcha token.

//  
await CaptchaaiPlugin.handler()
  .funcaptchaproxyless(websiteURL, websitePublicKey, funcaptchaApiJSSubdomain)
  .then((response) => {
    if(response.error !== 0){ 
        const token = response.apiResponse.solution;
    }else{ 
        const token = null; 
        console.log('[myapp][got error]' + JSON.stringify(response.apiResponse))
    }  
  }).catch(e => {
      console.log(e);
  })

🖱 Extra DOM Features

  • await CaptchaaiPlugin.hcaptchaclicker(page) - handle a page including hcaptcha iframe and trigger it, then emulates human clicks. example script (how to use).
puppeteer.launch({ headless: false })
.then(async browser => {
    let page = await browser.newPage();
    await page.goto(targeturl);
    await CaptchaaiPlugin.hcaptchaclicker(page, true)
    .then(async (page) => {
        // handle clicker success
        await page.click('#submit');
        await page.waitForNavigation();
    }).catch((e) => {
        // handle clicker error
        console.log(e);
    });

})

  • hcaptcha callback.
  • funcaptcha clicker.
  • funcaptcha callback.

📁 Examples

figure out at examples directory

Keywords

recaptcha

FAQs

Package last updated on 12 Nov 2022

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