Closed max-xoo closed 3 years ago
Which demo did you test out? I believe usually a circular json error from puppeteer has to do with how an element is selected/used. I've never encountered this issue so I would love to get to the bottom of it so I can push a fix for this if it is something on my end!
Ok look:
(node:2984) UnhandledPromiseRejectionWarning: Error: Evaluation failed: TypeError: Cannot read property 'useragent' of undefined at solveCaptcha (C:\Users\maxen\Desktop\hcaptchaBypass\node_modules\puppeteer-hcaptcha\hcaptcha.js:215:63) at Page._onBindingCalled (C:\Users\maxen\Desktop\hcaptchaBypass\node_modules\puppeteer\lib\cjs\puppeteer\common\Page.js:722:62) at C:\Users\maxen\Desktop\hcaptchaBypass\node_modules\puppeteer\lib\cjs\puppeteer\common\Page.js:151:60 at C:\Users\maxen\Desktop\hcaptchaBypass\node_modules\puppeteer\lib\cjs\vendor\mitt\src\index.js:51:62 at Array.map (
)
The code :
const puppeteer = require("puppeteer-extra")
const pluginStealth = require("puppeteer-extra-plugin-stealth")
const vision = require("@google-cloud/vision");
const { hcaptcha } = require("puppeteer-hcaptcha");
const client = new vision.ImageAnnotatorClient({
keyFilename: "AIzaSyCJdMDnyd4JPJEiBPT545P504N85NfLVIQ",
});
puppeteer.use(pluginStealth());
(async () => {
const browser = await puppeteer.launch({
ignoreHTTPSErrors: true,
headless: false,
args: [
`--window-size=600,1000`,
"--window-position=000,000",
"--disable-dev-shm-usage",
"--no-sandbox",
"--user-data-dir='/tmp/chromium'",
"--disable-web-security",
"--disable-features=site-per-process"
],
});
const [page] = await browser.pages();
await page.goto("https://2captcha.com/demo/hcaptcha")
await page.setDefaultNavigationTimeout(0);
await hcaptcha(page, client);
})();
and useragents.json :
{}
is good, just me :lol:
During my development it did not work, so I tested like the demo (same code and same site) and it does not work! So I can't use the package, here is the error:
answer this issue for more information.