Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const puppeteer = require('puppeteer-extra');
- const RecaptchaPlugin = require('puppeteer-extra-plugin-recaptcha');
- // Configure the plugin with a CAPTCHA-solving service provider (e.g., 2Captcha)
- puppeteer.use(RecaptchaPlugin({
- provider: { id: '2captcha', token: 'YOUR_2CAPTCHA_API_KEY' },
- }));
- (async () => {
- const browser = await puppeteer.launch({ headless: true });
- const page = await browser.newPage();
- // Navigate to a web page with a reCAPTCHA challenge
- await page.goto('https://www.example.com');
- // Solve reCAPTCHA challenges on the page
- const recaptchaSolutions = await page.solveRecaptchas();
- // Navigate to a sample website
- await page.goto('https://www.example.com');
- // Take a screenshot of the page
- await page.screenshot({ path: 'screenshot.png' });
- console.log(`Screenshot saved as screenshot.png`);
- // Close the browser
- await browser.close();
- })();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement