nocaptchaai / nocaptchaai-puppeteer Goto Github PK
View Code? Open in Web Editor NEWPuppeteer package for NoCaptchaAI (hCaptcha solver) ⚡️
Home Page: https://noCaptchaAI.com
Puppeteer package for NoCaptchaAI (hCaptcha solver) ⚡️
Home Page: https://noCaptchaAI.com
admin said that 6 seconds should pass between clicking checkbox and submitting the clicked images, otherwise hcaptcha likely just asks for another image challenge.
plugin must make sure that 6 seconds have passed before submitting.
This events bypass telemetry protection.
And scheme will be hover().then(() => {focus().then(() => {click()})})
the plugin does not click images from challenge if puppeteer window is minimized
this is actually a huge issue, because when running (multiple) instances on a remote desktop, only one window at the time is "active" and all others are treated like they are "minimized"
therefore plugin works very slow when multithreading on rdp
the bug is in general cause it doesnt do clicks when the window is minimized.
all other puppeteer stuff works fine even though windows are minimized, so this is an issue with this plugin.
hcaptcha sometimes throws error that there were too many recent requests from current network when trying to check checkbox.
please detect (correctly) so we can handle it or speedup process
i tried myself and did not succeed.
`/home/ymajine/Bureau/triage /PlutonBot/node_modules/nocaptchaai-puppeteer/lib/index.js:22
const outer = await page.waitForSelector('iframe[data-hcaptcha-response]');
^
TypeError: page.waitForSelector is not a function
at solveCaptcha (/home/ymajine/Bureau/triage /PlutonBot/node_modules/nocaptchaai-puppeteer/lib/index.js:22:30)
at main (/home/ymajine/Bureau/triage /PlutonBot/Modules/captchatest.js:17:9)
Node.js v18.12.1`
this is my code 👍
`const puppeteer = require ('puppeteer');
const {solveCaptcha} = require('nocaptchaai-puppeteer');
const URL = 'https://2captcha.com/demo/hcaptcha';
//**** get apikey here -> http://nocaptchaai.com *****
const API_KEY = 'replace by my api key '; // <-- your API key here
const UID = 'jesaispasmdr'; // <-- your UID here
const lang = 'en'; // desired language. 'en' = english, 'ru' = russian
const main = async ()=> {
const browser = await puppeteer.launch({ headless: false, args: [--lang=${lang}
] });
const page = await browser.newPage();
await page.goto('https://2captcha.com/demo/hcaptcha');
await page.waitForNetworkIdle();
await solveCaptcha(URL, API_KEY, UID, 'free', true);
// params: 'free or pro', 5) debug -> true or false
console.log('passed')
await page.screenshot({ path: example/test.jpeg
, type: 'jpeg' });
await browser.close();
};
main();`
if image-challenge-popup already exists, calling solveCaptcha will click checkbox again, therefore making image challenge disappear
i myself use solveCaptcha only if imagechallenge exists. also necessary for invisible captcha because there is no checkbox to be clicked.
Suggested Solution:
check if image challenge already exists or not. if not, click checkbox.
var challengecheck = (await innerFrame.evaluate(()=>document.querySelector("body .challenge"))) || "";
if (!challengecheck) {
await checkbox?.click();
}
this aint working
const language = await page.evaluate(() => document.documentElement.lang);
console.log(language) returns empty
Upon clicking submit button with invisible hcaptcha, when it pops up image challenge, if i then call solveCaptcha it will always cause the following error. The image-challenge popup also breaks and visually shows the chrome error like if a tab crashed within the frame the challenge popup was.
Received fatal exception E
![acccessviolation](https://user-images.githubusercontent.com/117991528/201343822-3f6f8319-8eab-4b32-9710-7c1b775a9d84.JPG)
XCEPTION_ACCESS_VIOLATION
[11/11/2022, 00:42:25] [puppeteer]: CHROMIUM: Received fatal exception EXCEPTION_ACCESS_VIOLATION
Backtrace:
[11/11/2022, 00:42:25] [puppeteer]: CHROMIUM: Backtrace:
GetHandleVerifier [0x00007FFF15679A13+28527139]
CrashForExceptionInNonABICompliantCodeRange [0x00007FFF126D04FF+6179695]
CrashForExceptionInNonABICompliantCodeRange [0x00007FFF121AA9D6+782406]
GetHandleVerifier [0x00007FFF156646DB+28440299]
GetHandleVerifier [0x00007FFF156644B6+28439750]
CrashForExceptionInNonABICompliantCodeRange [0x00007FFF124F4E63+4232403]
GetMainTargetServices [0x00007FFF12F7C5A1+2210497]
GetHandleVerifier [0x00007FFF13BC5C5F+527471]
GetMainTargetServices [0x00007FFF12F7D706+2214950]
GetMainTargetServices [0x00007FFF130348E6+2964998]
GetMainTargetServices [0x00007FFF12F7EC38+2220376]
GetMainTargetServices [0x00007FFF12E74367+1128583]
RelaunchChromeBrowserWithNewCommandLineIfNeeded [0x00007FFF13B38F95+[11/11/2022, 00:42:25] [puppeteer]: CHROMIUM: GetHandleVerifier [0x00007FFF15679
![acccessviolation](https://user-images.githubusercontent.com/117991528/201343886-4a90d541-56eb-442b-8eac-92f0267af1da.JPG)
A13+28527139]
CrashForExceptionInNonABICompliantCodeRange [0x00007FFF126D04FF+6179695]
CrashForExceptionInNonABICompliantCodeRange [0x00007FFF121AA9D6+782406]
GetHandleVerifier [0x00007FFF156646DB+28440299]
GetHandleVerifier [0x00007FFF156644B6+28439750]
CrashForExceptionInNonABICompliantCodeRange [0x00007FFF124F4E63+4232403]
GetMainTargetServices [0x00007FFF12F7C5A1+2210497]
GetHandleVerifier [0x00007FFF13BC5C5F+527471]
GetMainTargetServices [0x00007FFF12F7D706+2214950]
GetMainTargetServices [0x00007FFF130348E6+2964998]
GetMainTargetServices [0x00007FFF12F7EC38+2220376]
GetMainTargetServices [0x00007FFF12E74367+1128583]
RelaunchChromeBrowserWithNewCommandLineIfNeeded [0x00007FFF13B38F95+
887173]
RelaunchChromeBrowserWithNewCommandLineIfNeeded [0x00007FFF13B38A25+885781]
RelaunchChromeBrowserWithNewCommandLineIfNeeded [0x00007FFF13B2CC29+837145]
RelaunchChromeBrowserWithNewCommandLineIfNeeded [0x00007FFF13B399DB+889803]
GetMainTargetServices [0x00007FFF12E53F3D+996445]
GetMainTargetServices [0x00007FFF139C5A22+12996418]
CrashForExceptionInNonABICompliantCodeRange [0x00007FFF12D0B52B+12712859]
CrashForExceptionInNonABICompliantCodeRange [0x00007FFF12D0C1FC+12716140]
CrashForExceptionInNonABICompliantCodeRange [0x00007FFF12D0ADF2+12711010]
CrashForExceptionInNonABICompliantCodeRange [0x00007FFF12D0AF1F+12711311]
ChromeMain [0x00007FFF0FC6127C+476]
[11/11/2022, 00:42:25] [puppeteer]: CHROMIUM: 887173]
RelaunchChromeBrowserWithNewCommandLineIfNeeded [0x00007FFF13B38A25+885781]
RelaunchChromeBrowserWithNewCommandLineIfNeeded [0x00007FFF13B2CC29+837145]
RelaunchChromeBrowserWithNewCommandLineIfNeeded [0x00007FFF13B399DB+889803]
GetMainTargetServices [0x00007FFF12E53F3D+996445]
GetMainTargetServices [0x00007FFF139C5A22+12996418]
CrashForExceptionInNonABICompliantCodeRange [0x00007FFF12D0B52B+12712859]
CrashForExceptionInNonABICompliantCodeRange [0x00007FFF12D0C1FC+12716140]
CrashForExceptionInNonABICompliantCodeRange [0x00007FFF12D0ADF2+12711010]
CrashForExceptionInNonABICompliantCodeRange [0x00007FFF12D0AF1F+12711311]
ChromeMain [0x00007FFF0FC6127C+476]
GetPakFileHashes [0x00007FF718F927A4+6052]
GetPakFileHashes [0x00007FF718F91B3B+2875]
GetHandleVerifier [0x00007FF7190FC072+981570]
[11/11/2022, 00:42:25] [puppeteer]: CHROMIUM: GetPakFileHashes [0x00007FF718F927A4+6052]
GetPakFileHashes [0x00007FF718F91B3B+2875]
GetHandleVerifier [0x00007FF7190FC072+981570]
BaseThreadInitThunk [0x00007FFF48E97034+20]
[11/11/2022, 00:42:25] [puppeteer]: CHROMIUM: BaseThreadInitThunk [0x00007FFF48E97034+20]
RtlUserThreadStart [0x00007FFF49822651+33]
[11/11/2022, 00:42:25] [puppeteer]: CHROMIUM: RtlUserThreadStart [0x00007FF
```F49822651+33]
doesn't work on discord. got error: failed to find element matching selector ".h-captcha"
otherwise its not working for me on my site, also this way is more correct:
//const inner = await page.waitForSelector('iframe:not([data-hcaptcha-response])');
const inner = await page.$("iframe[title='Main content of the hCaptcha challenge']",);
Hello,
Code : `ts
import { solveCaptcha } from "nocaptchaai-puppeteer";
import puppeteer from "puppeteer";
const URL = "https://accounts.hcaptcha.com/demo";
const API_KEY = "animalescrossingosda"; // <-- your API key here
const UID = "animalescrossingosda-6ab13ff2-c94c-6a36-3b5d-e0dd16e4e918"; // <-- your UID here
const main = async (): Promise => {
const browser = await puppeteer.launch({ headless: false });
const page = await browser.newPage();
await page.goto(URL);
await page.waitForNetworkIdle();
await solveCaptcha(page, API_KEY, UID, "free");
await page.screenshot({ path: "test.jpeg", type: "jpeg" });
await browser.close();
};
main();`
Error : Uncaught SyntaxError c:\Users\user\Dropbox\PC\Downloads\captcha\app.ts:1
import { solveCaptcha } from "nocaptchaai-puppeteer";
^^^^^^
SyntaxError: Cannot use import statement outside a module
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.