Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/shahzain345/puppeteer-hcaptcha-solver
Solve hcaptcha with puppeteer.
https://github.com/shahzain345/puppeteer-hcaptcha-solver
Last synced: 5 days ago
JSON representation
Solve hcaptcha with puppeteer.
- Host: GitHub
- URL: https://github.com/shahzain345/puppeteer-hcaptcha-solver
- Owner: shahzain345
- Created: 2022-05-12T19:54:21.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2022-10-17T12:00:29.000Z (about 2 years ago)
- Last Synced: 2024-04-24T23:20:14.459Z (7 months ago)
- Language: TypeScript
- Homepage:
- Size: 10.8 MB
- Stars: 22
- Watchers: 3
- Forks: 5
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Puppeteer-hcaptcha-solver
Solve Hcaptcha on any website using puppeteer
Author: Shahzain
PRS Are greatly appreciated.
# Installation:
`yarn add puppeteer-hcaptcha-solver`
`npm install puppeteer-hcaptcha-solver`
## Basic Usage:
Note: You need python to use this module.
```js
const { PuppeterHcaptchaSolve } = require("puppeteer-hcaptcha-solver");
const puppeteer = require("puppeteer");
(async () => {
const browser = await puppeteer.launch({ headless: false });
const captcha = new PuppeterHcaptchaSolve(browser); // if you want to use ghost-cursor to make human-like mousemovements simply set `use_gc` to true, like this `new PuppeterHcaptchaSolve(browser, true)`
try {
const page = await browser.newPage()
await page.setDefaultNavigationTimeout(0);await page.goto("https://accounts.hcaptcha.com/demo?sitekey=4c672d35-0701-42b2-88c3-78380b0db560", {
waitUntil: 'load',
timeout: 0});
await page.waitForSelector("iframe")
console.log("Hcaptcha detected")
setTimeout(async () => {
const token = await captcha.solve(page); // this function will return the hcaptcha_token string which u can use in other applications as well.
console.log(token)
}, 2000)
} catch (e) {
throw e
}
})()
```
# Does this package support puppeteer-extra?Yes! It does support puppeteer-extra.
# Puppeteer-Hcaptcha-Solver in action
![](https://hi.shahzain.me/r/puppeteer-hcaptcha.gif)
# Credits[QIN2DIM](https://github.com/QIN2DIM) For his great AI work.