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 🙏

© 2024 – Pkg Stats / Ryan Hefner

puppeteer-slider-solve

v1.0.2

Published

slider captcha solution using puppeteer and 2captcha captcha solution service

Downloads

47

Readme

Slider captcha solution using puppeteer and 2CAPTCHA captcha solution service

Suitable for any slider captcha

Install

npm install puppeteer-slider-solve

Use

Add to yours .env file is your API KEY of the 2CAPTCHA service, if you are not registered, you can register using this link 2CAPTCHA

Example .env

TOKEN=YOUR_API_KEY_2CAPTCHA

Example

await solveSlider(page,"captcha","#captcha__frame",".slider",10)
//IF CAPTCHA NOT IN FRAME
await solveSlider(page,false,'.geetest_holder.geetest_mobile.geetest_ant.geetest_embed',".geetest_slider_button",-25)

Fields

Supported options field are listed below.

| Field | Type | Default value | Required | Description | | --- |-------------| --- | --- |-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | page | Page | | Yes | puppeteer page object | | src | String(Boolean) | | Yes | Src frame where the captcha is located (or a distinctive feature of src for example "https://captcha.uvfuns.com ") or false if the captcha is not in the frame |
| container | String | | Yes | The selector of the HTML block where the captcha is located | | slider | String | | Yes | The selector of the HTML block where the slider is located | | shift | Number | 0 | No | Shift if the slider does not behave linearly (it can be either a positive number or a negative number)

Full Example

import puppeteer from "puppeteer";
import { solveSlider } from "puppeteer-slider-solve";

(async () => {
  const browser = await puppeteer.launch({
    args: ["--start-maximized"],
    defaultViewport:false,
    headless: 'new',
    slowMo: 250
  });
  const [page] = await browser.pages();
  await page.goto("https://www.geetest.com/en/adaptive-captcha-demo", {
    waitUntil: "networkidle2",
  });
  await page.waitForSelector(".tab-item.tab-item-1", {
    timeout: 25000,
    visible: true,
  });
  await page.click(".tab-item.tab-item-1");
  await page.waitForSelector('div[aria-label="Click to verify"]', {
    timeout: 25000,
    visible: true,
  });
  await page.click('div[aria-label="Click to verify"]');
  await page.waitForSelector(".geetest_box", { timeout: 25000, visible: true });
  await solveSlider(page, false, ".geetest_box", ".geetest_btn", 0);
  await page.screenshot({ path: "demo.png" });
  await browser.close();
})();

Demo

https://github.com/user-attachments/assets/b0139b96-e083-4f58-8876-8722d3dc5086