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

Captchas not solved when iframe not in a form #57

Closed
tuckerconnelly opened this issue Aug 16, 2019 · 2 comments
Closed

Captchas not solved when iframe not in a form #57

tuckerconnelly opened this issue Aug 16, 2019 · 2 comments
Labels
planned-feature Will be added in a future release

Comments

@tuckerconnelly
Copy link

tuckerconnelly commented Aug 16, 2019

This line here assumes that recaptcha is in a form: https://github.com/berstend/puppeteer-extra/blob/master/packages/puppeteer-extra-plugin-recaptcha/src/content.ts#L142

But there are certain sites that do not wrap their captcha in a form.

Workaround is to move the captcha to a form on the page before calling the page.solveRecaptchas() function:

    await page.evaluate(() => {
      document
        .querySelector('form')
        .append(document.querySelector('#login-recaptcha'));
    });
    await page.solveRecaptchas();

Thank you very much for this library, extremely helpful, but my 17 years of experience are telling me the source code is a bit over-engineered. I recommend only using a function or two instead of a class when possible. Nonetheless, thank you so much, this library saved my tush :)

@berstend
Copy link
Owner

berstend commented Dec 5, 2019

Over-engineering is in the eyes of the beholder 😄 Would I write the code differently now (after a year)? Of course, I understand the problem domain much better now. Do I think a function or two would be more maintainable than using TypeScript classes for organizing the code? My 20 years of experience are not so sure about that 😜

But yeah, the code could benefit from some refactoring but ain't no one got time for that. :)

I'll see that I incorporate the form fix in one of the future updates, thanks!

@berstend berstend added the planned-feature Will be added in a future release label Dec 5, 2019
@berstend
Copy link
Owner

berstend commented Jan 5, 2020

Fixed in puppeteer-extra-plugin-recaptcha@3.1.9 :)

@berstend berstend closed this as completed Jan 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
planned-feature Will be added in a future release
Projects
None yet
Development

No branches or pull requests

2 participants