https://2captcha.com/de/demo/hcaptcha
Puppeteer is a Node library that provides a high-level API to control headless Chrome or Chromium over the DevTools Protocol. It can be used to automate web tasks such as web scraping, testing, and solving CAPTCHAs. hCaptcha is a popular CAPTCHA service that is used to protect websites from bots and spam. Here are some things to know about using Puppeteer to solve hCaptcha:
Puppeteer-hcaptcha: Puppeteer-hcaptcha is a library that can be used to solve hCaptcha challenges that are automated within Puppeteer[1]. It 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. The average response time is roughly 13 - 20 seconds with TensorFlow's Image Recognition. If you like this project feel free to donate!
Puppeteer-hcaptcha-solver: Puppeteer-hcaptcha-solver is another library that can be used to solve hCaptcha on any website using Puppeteer[2]. It requires Python to use this module. It supports puppeteer-extra and ghost-cursor to make human-like mouse movements.
Capsolver Extension: Capsolver Extension is a browser extension that can be used to solve hCaptcha with Puppeteer[6]. It has many settings, including automatic solution of the specified type of captcha, support for proxy, and other settings.
To use Puppeteer-hcaptcha, you can require puppeteer-extra and puppeteer-extra-plugin-stealth, and then require the hcaptcha method from puppeteer-hcaptcha. You can also require the hcaptchaToken method from puppeteer-hcaptcha to get the response token. Here is an example of how to use Puppeteer-hcaptcha:
// Require puppeteer extra and puppeteer stealth
const puppeteer = require("puppeteer-extra");
const pluginStealth = require("puppeteer-extra-plugin-stealth");
// Require our hcaptcha method
const { hcaptcha } = require("puppeteer-hcaptcha");
// Tell puppeteer to use puppeteer stealth
puppeteer.use(pluginStealth());
(async () => {
// Instantiate a new browser object
// Ignore errors associated to https...
const browser = await puppeteer.launch({
headless: true,
args: ["--no-sandbox", "--disable-setuid-sandbox"],
});
// Instantiate a new page object
const page = await browser.newPage();
// Navigate to the page with the captcha on it
await page.goto("https://example.com");
// Wait for the captcha to load
await page.waitForSelector("#captcha");
// Solve the captcha
await hcaptcha(page);
// Submit the form
await page.click("#submit");
// Close the browser
await browser.close();
})();
To use Puppeteer-hcaptcha-solver, you can require puppeteer and then require the PuppeterHcaptchaSolve class from puppeteer-hcaptcha-solver. Here is an example of how to use Puppeteer-hcaptcha-solver:
// Require puppeteer and puppeteer-hcaptcha-solver
const puppeteer = require("puppeteer");
const { PuppeterHcaptchaSolve } = require("puppeteer-hcaptcha-solver");
(async () => {
// Instantiate a new browser object
const browser = await puppeteer.launch({ headless: false });
// Instantiate a new captcha object
const captcha = new PuppeterHcaptchaSolve(browser);
// Instantiate a new page object
const page = await browser.newPage();
// Navigate to the page with the captcha on it
await page.goto("https://example.com");
// Wait for the captcha to load
await page.waitForSelector("#captcha");
// Solve the captcha
const token = await captcha.solve(page);
// Submit the form
await page.click("#submit");
// Close the browser
await browser.close();
})();
To use Capsolver Extension, you need to install puppeteer, puppeteer-extra, and puppeteer-extra-plugin-stealth. You also need to download the archive with the extension, and unzip it to the folder ./CapSolver.Browser.Extension in the root of the project. Here is an example of how to use Capsolver Extension:
// Require puppeteer and puppeteer-extra
const puppeteer = require("puppeteer");
const puppeteerExtra = require("puppeteer-extra");
// Require puppeteer-extra-plugin-stealth
const stealthPlugin = require("puppeteer-extra-plugin-stealth");
// Use puppeteer-extra and stealthPlugin
puppeteerExtra.use(stealthPlugin());
(async () => {
// Launch a new browser
const browser = await puppeteerExtra.launch({
headless: false,
args: ["--no-sandbox", "--disable-setuid-sandbox"],
});
// Create a new page
const page = await browser.newPage();
// Go to the page with the captcha
await page.goto("https://example.com");
// Wait for the captcha to load
await page.waitForSelector("#captcha");
// Solve the captcha
await page.solveHcaptcha();
// Submit the form
await page.click("#submit");
// Close the browser
await browser.close();
})();
In conclusion, Puppeteer can be used to solve hCaptcha challenges on websites. There are several libraries and extensions available that can help automate the process. However, it is important to use these tools ethically and legally.