https://github.com/dzmitry-duboyski/normal-captcha-example
Solve normal (image) captcha with puppeteer and 2captcha
https://github.com/dzmitry-duboyski/normal-captcha-example
2captcha base64 captcha captcha-recognition captcha-solver captcha-solving imagecaptcha javascript nodejs peppeteer puppeteer-demo
Last synced: 22 days ago
JSON representation
Solve normal (image) captcha with puppeteer and 2captcha
- Host: GitHub
- URL: https://github.com/dzmitry-duboyski/normal-captcha-example
- Owner: dzmitry-duboyski
- License: mit
- Created: 2022-09-06T15:30:19.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-11-03T20:51:44.000Z (over 2 years ago)
- Last Synced: 2025-03-02T09:16:31.954Z (over 1 year ago)
- Topics: 2captcha, base64, captcha, captcha-recognition, captcha-solver, captcha-solving, imagecaptcha, javascript, nodejs, peppeteer, puppeteer-demo
- Language: JavaScript
- Homepage:
- Size: 52.7 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:
