berstend / puppeteer-extra

💯 Teach puppeteer new tricks through plugins.
https://extra.community
MIT License
6.24k stars 732 forks source link

[Bug] TimeoutError: waiting for function failed: timeout 10000ms exceeded #432

Open khalitovsv opened 3 years ago

khalitovsv commented 3 years ago

index.cjs.js:760

return window.___grecaptcha_cfg && window.___grecaptcha_cfg.count

Must be replaced with

return window.___grecaptcha_cfg && (window.___grecaptcha_cfg.count || window.___grecaptcha_cfg.isolated_count)

Otherwise in some sites we will get TimeoutError, for example here:

https://www.reestr-zalogov.ru/search/index

berstend commented 3 years ago

This is most likely fixed already in the upcoming @extra/recaptcha: https://github.com/berstend/puppeteer-extra/blob/automation-extra/packages/plugin-recaptcha/src/index.ts#L77

If you want to you can test the new version and let me know if it works: https://github.com/berstend/puppeteer-extra/pull/303#issuecomment-775277480

I probably don't have time to backport this fix to the current (and soon obsolete) recaptcha plugin.

wywywywy commented 3 years ago

Just to make sure, does that mean we should stop using puppeteer-extra-plugin-recaptcha because it will become unmaintained, and move to the @extra/recaptcha from now?

EDIT - Not now, I mean when it's out of beta

jtmilne commented 3 years ago

Neither of these suggested solutions work for https://biz.yelp.com/login

Tried both:

return Object.keys((window.___grecaptcha_cfg || {}).clients || {}).length

return window.___grecaptcha_cfg && (window.___grecaptcha_cfg.count || window.___grecaptcha_cfg.isolated_count)

They both result in timeout 10000ms exceeded

Quentin-M commented 3 years ago

Hey there,

Also having issues with either solutions on a couple of sites (using @extra//@next). Happy to give you the links in private as necessary.

Trace: TimeoutError: waiting for function failed: timeout 10000ms exceeded
    at new WaitTask (node_modules\puppeteer\lib\cjs\puppeteer\common\DOMWorld.js:509:34)
    at DOMWorld.waitForFunction (node_modules\puppeteer\lib\cjs\puppeteer\common\DOMWorld.js:464:26)
    at Frame.waitForFunction (node_modules\puppeteer\lib\cjs\puppeteer\common\FrameManager.js:909:32)
    at Page.waitForFunction (node_modules\puppeteer\lib\cjs\puppeteer\common\Page.js:1286:33)
    at RecaptchaPlugin.findRecaptchas (node_modules\@extra\recaptcha\dist\index.cjs.js:756:24)

Best.

berstend commented 3 years ago

@Quentin-M interested in the sites where this is failing, kindly DM me on discord :-)

berstend commented 3 years ago

@jtmilne yelp configured this weirdly, it seems they added the recaptcha script but are not using it?

image

Did you see an active recaptcha on that site in your tests? If so I'm interested in what window.___grecaptcha_cfg looks like while a checkbox/challenge is shown.