You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
importpuppeteerfrom'puppeteer';import{solveCaptcha}from'nocaptchaai-puppeteer';constURL='https://accounts.hcaptcha.com/demo?sitekey=4c672d35-0701-42b2-88c3-78380b0db560';constAPI_KEY='api_key';// <-- your API key hereconstmain=async(): Promise<void>=>{const browser =awaitpuppeteer.launch({channel: 'chrome',headless: false});constpage=awaitbrowser.newPage();awaitpage.goto(URL);awaitpage.waitForNetworkIdle();awaitsolveCaptcha(page,API_KEY,'uid','pro',false);awaitpage.waitForSelector('#hcaptcha-demo-submit');// Click the button with id "hcaptcha-demo-submit"awaitpage.click('#hcaptcha-demo-submit');// Wait for the navigation to complete after clicking the button//await page.waitForNavigation({ waitUntil: 'load' });consthtmlContent=awaitpage.content();constregex=/Token:<p><\/p><p>(.*?)<\/p>/;// Use the regular expression to extract the tokenconstmatch=htmlContent.match(regex);if(match&&match.length>1){consttoken=match[1];console.log('hCaptcha Response Token:',token);}else{console.log('hCaptcha Response Token not found in the HTML content.');}awaitbrowser.close();};main();
doesn't work on discord. got error:
failed to find element matching selector ".h-captcha"
The text was updated successfully, but these errors were encountered: