Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: Evaluation failed: TypeError: Cannot read property 'src' of null #2

Closed
klotein opened this issue Mar 28, 2021 · 11 comments
Closed
Labels
bug Something isn't working

Comments

@klotein
Copy link

klotein commented Mar 28, 2021

const puppeteer = require('puppeteer-extra')
const pluginStealth = require('puppeteer-extra-plugin-stealth')
const vision = require("@google-cloud/vision");

const { hcaptchaToken } = require('puppeteer-hcaptcha');

const client = new vision.ImageAnnotatorClient({
keyFilename: "YOUR GOOGLE CREDENTIALS",
});

puppeteer.use(pluginStealth());

(async () => {

let token = await hcaptchaToken('https://nooooder.xyz', client);

// W0_eyJ0eXAiOiJ...
console.log(token);

})();

@klotein
Copy link
Author

klotein commented Mar 28, 2021

i tried on windows and linux(debain) i got some Error: Evaluation failed: TypeError: Cannot read property 'src' of null

@klotein
Copy link
Author

klotein commented Mar 28, 2021

(node:5312) UnhandledPromiseRejectionWarning: Error: Evaluation failed: TypeError: Cannot read property 'src' of null
at puppeteer_evaluation_script:5:6
at ExecutionContext._evaluateInternal (C:\Users\ops\node_modules\puppeteer\lib\cjs\puppeteer\common\ExecutionContext.js:218:19)
at processTicksAndRejections (internal/process/task_queues.js:93:5)
at async ExecutionContext.evaluate (C:\Users\ops\node_modules\puppeteer\lib\cjs\puppeteer\common\ExecutionContext.js:107:16)
at async hcaptchaToken (C:\Users\ops\node_modules\puppeteer-hcaptcha\hcaptcha.js:249:11)
at async C:\Users\ops\Desktop\den\server.js:18:17
(Use node --trace-warnings ... to show where the warning was created)
(node:5312) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:5312) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

@awxlfy
Copy link
Collaborator

awxlfy commented Mar 28, 2021

Thats a cloudflare site. The solver doesn't currently work on cloudflare sites but I will work on fixing this now. Thanks for reporting the issue to me!

@awxlfy
Copy link
Collaborator

awxlfy commented Mar 28, 2021

Looks like a few things are different for this websites hcaptcha responses. I'm not entirely sure if this is a universal case for all cloudflare hcaptcha responses but I have fixed this issue. Do you mind sending me a few other sites that use cloudflare to test out if this fix is universal for them all?

@klotein
Copy link
Author

klotein commented Mar 28, 2021

@awxlfy awxlfy added the bug Something isn't working label Mar 28, 2021
@awxlfy
Copy link
Collaborator

awxlfy commented Mar 28, 2021

@klotein perfect I'll double check now and push a fix if thats true

@klotein
Copy link
Author

klotein commented Mar 28, 2021

waiting sir, good luck

@awxlfy
Copy link
Collaborator

awxlfy commented Mar 28, 2021

Seems like its universal. Going to run a few more quick tests and then a fix will be pushed! Again, thanks for bringing this to my attention.

@klotein
Copy link
Author

klotein commented Mar 28, 2021

You're welcome.

@awxlfy
Copy link
Collaborator

awxlfy commented Mar 28, 2021

I was currently in the process of making the image recognition better so that responses were faster so just gotta revert those changes quickly so it'll take a few minutes

@awxlfy
Copy link
Collaborator

awxlfy commented Mar 28, 2021

New patch is up, enjoy!

@awxlfy awxlfy closed this as completed Mar 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants