A simple puppeteer-extra
plugin, made possible with Tessaract.js.
Note: This plugin is still under development and has not been tested in production.
npm i @mihnea.dev/puppeteer-extra-amazon-captcha
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)
}
Copyright © 2023, Mihnea Manolache. Released under the MIT License.