@mihnea.dev/puppeteer-extra-amazon-captcha
v1.0.3
Published
A puppeteer-extra plugin to solve Amazon captchas using Tessaract.JS.
Downloads
116
Maintainers
Readme
Puppeteer Extra Amazon Captcha Plugin
A simple puppeteer-extra
plugin, made possible with Tessaract.js.
Note: This plugin is still under development and has not been tested in production.
Installation
npm i @mihnea.dev/puppeteer-extra-amazon-captcha
Usage
import AmazonCaptchaPlugin from "@mihnea.dev/puppeteer-extra-amazon-captcha";
import puppeteer from 'puppeteer-extra';
try {
const amazonCaptchaPlugin = AmazonCaptchaPlugin.default();
puppeteer.use(amazonCaptchaPlugin);
const browser = await puppeteer.launch({
headless: false,
ignoreHTTPSErrors: true,
});
const page = await browser.newPage();
await page.goto("https://www.amazon.com/errors/validateCaptcha");
/** Important: Delay code execution until URL no longer includes "error" */
await page.waitForFunction(() => !window.location.href.includes("error"));
await page.close();
await browser.close();
} catch (e) {
console.log("Error launching puppeteer: " + e.message)
}
License
Copyright © 2023, Mihnea Manolache. Released under the MIT License.