Puppeteer-extra: Recaptcha in iFrame

Created on 30 Nov 2019  路  8Comments  路  Source: berstend/puppeteer-extra

I wonder if there is a way how to use puppeteer-extra-plugin-recaptcha for a Recaptcha which is in within an iFrame (I do not mean recaptchas iFrame). solveRecaptchas() method is registered only in pages-context. Not sure how to use it with frames.

Any idea?

All 8 comments

Good point! I'm checking the puppeteer docs right now to see if there's a good hook for this.

Alright, seems to be just a matter of looping through page.mainFrame().childFrames().

@svenadlung, what would be the better default, checking all iframes or only when opting-in?

Currently leaning towards an allFrames: true plugin option as the default for better out of the box experience. :)

Or would it be better to keep it manual for the user so they can choose in which frame they try to solve captchas?

@berstend thx for your quick reply. For me it doesn't matter actually. I guess it's cant be too bad to check all frames and keeps the plugin easy to use. Maybe add a manual option as well - but keep scanning all frames by default?

I've added the custom captcha methods to potential Frames as well:

for (const frame of page.mainFrame().childFrames()) {
  await frame.solveRecaptchas()
}

Will tests this a bit more and push a new release soon :)

Wow, perfect! Can't wait to test it as well. Thx for your effort!

@svenadlung Frames are now supported with [email protected].

Documentation: https://github.com/berstend/puppeteer-extra/tree/master/packages/puppeteer-extra-plugin-recaptcha#solving-captchas-in-iframes

Please ping if you experience any issues with the new frame support :)

Awesome! Works like a charm. Thank you so much.

Was this page helpful?
0 / 5 - 0 ratings