Switched to puppeteer-real-browser, but captchas remain unsolved. How can I integrate a recaptcha solver with this library? See sample code below:
import fs from 'fs';
import puppExtra from 'puppeteer-extra';
import { initiateConnection } from 'puppeteer-real-browser';
import Camouflage from 'puppeteer-extra-plugin-stealth';
import captchaResolver from 'puppeteer-extra-plugin-recaptcha';
(async function run() {
try {
const { currentPage, activeBrowser } = await initiateConnection({ headless: true, args: [] });
puppExtra.use(new Camouflage());
puppExtra.use(new captchaResolver({
provider: { id: '2captcha', key: 'your-api-key' },
visualFeedback: true,
throwOnError: true
}));
// Additional integration steps...
} catch (error) {
console.error('Error:', error.message);
}
})();