Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dzmitry-duboyski/normal-captcha-example
Solve normal (image) captcha with puppeteer
https://github.com/dzmitry-duboyski/normal-captcha-example
2captcha captcha captcha-recognition captcha-solver captcha-solving imagecaptcha javascript nodejs peppeteer puppeteer-demo
Last synced: 1 day ago
JSON representation
Solve normal (image) captcha with puppeteer
- Host: GitHub
- URL: https://github.com/dzmitry-duboyski/normal-captcha-example
- Owner: dzmitry-duboyski
- License: mit
- Created: 2022-09-06T15:30:19.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2023-11-03T20:51:44.000Z (about 1 year ago)
- Last Synced: 2023-11-03T21:33:58.736Z (about 1 year ago)
- Topics: 2captcha, captcha, captcha-recognition, captcha-solver, captcha-solving, imagecaptcha, javascript, nodejs, peppeteer, puppeteer-demo
- Language: JavaScript
- Homepage:
- Size: 49.8 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# How to automate an image-based captcha solution in JavaScript
## Description
In this example, you can see how automate an image-based captcha solution in JavaScript using [Puppeteer](https://pptr.dev/) and the 2captcha service.
[Puppeteer](https://pptr.dev/) is Node.js library using for automation. [2captcha](https://2captcha.com) is service used to solve the captcha.### Presetting
Set your `API KEY` in the file [./index.js#L3](./index.js#L5)`APIKEY=yourApiKey`
### Usage
`npm i`
`npm run start`
### Example
```js
const getCaptchaAnswer = async () => {
try {
//send captcha
const base64Captcha = fs.readFileSync("./image_captcha.png", "base64");
const res = await solver.imageCaptcha({
body: base64Captcha,
});
return res.data;
} catch (err) {
console.log(err);
}
};
```Screenshot:
![imageCaptcha](https://user-images.githubusercontent.com/38065632/236539708-ee094431-2be8-4629-97b7-285871cffba1.gif)