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

reCaptcha complains about automated queries when running headlessly #44

Closed
pws1453 opened this issue Dec 12, 2021 · 8 comments
Closed

Comments

@pws1453
Copy link
Contributor

pws1453 commented Dec 12, 2021

Throwing an issue found during development of #25 here. Recaptcha seems not to like Chrome's headless browser/

<div style="">
        <div>
            <div>
                <div class="rc-doscaptcha-header">
                    <div class="rc-doscaptcha-header-text" style="font-size: 22px;">Try again later</div>
                </div>
                <div class="rc-doscaptcha-body">
                    <div class="rc-doscaptcha-body-text" tabindex="0" style="font-size: 16px;">Your computer or network
                        may be sending automated queries. To protect our users, we can\'t process your request right
                        now. For more details visit <a
                            href="https://developers.google.com/recaptcha/docs/faq#my-computer-or-network-may-be-sending-automated-queries"
                            target="_blank">our help page</a>.</div>
                </div>
            </div>
            <div class="rc-doscaptcha-footer">
                <div class="rc-footer">
                    <div class="rc-separator"></div>
                    <div class="rc-controls">
                        <div class="primary-controls">
                            <div class="rc-buttons">
                                <div class="button-holder reload-button-holder"><button
                                        class="rc-button goog-inline-block rc-button-reload rc-button-disabled"
                                        title="Get a new challenge" value="" id="recaptcha-reload-button"
                                        disabled=""></button></div>
                                <div class="button-holder audio-button-holder"><button
                                        class="rc-button goog-inline-block rc-button-audio rc-button-disabled"
                                        title="Get an audio challenge" value="" id="recaptcha-audio-button"
                                        disabled=""></button></div>
                                <div class="button-holder image-button-holder"><button
                                        class="rc-button goog-inline-block rc-button-image rc-button-disabled"
                                        title="Get a visual challenge" value="" id="recaptcha-image-button" disabled=""
                                        style="display: none;"></button></div>
                                <div class="button-holder help-button-holder"><button
                                        class="rc-button goog-inline-block rc-button-help rc-button-disabled"
                                        title="Help" value="" id="recaptcha-help-button" disabled=""></button></div>
                                <div class="button-holder undo-button-holder"><button
                                        class="rc-button goog-inline-block rc-button-undo" title="Undo" value=""
                                        id="recaptcha-undo-button" tabindex="0" style="display: none;"></button></div>
                            </div>
                            <div class="verify-button-holder"><button
                                    class="rc-button-default goog-inline-block rc-button-default-disabled" title=""
                                    value="" id="recaptcha-verify-button" disabled="">Verify</button></div>
                        </div>
                        <div class="rc-challenge-help" style="display:none" tabindex="0"></div>
                    </div>
                </div>
            </div>
        </div>
    </div>
@bolshoytoster
Copy link
Contributor

There's a patched version of the chromedriver that is designed to be undetectable to things like this. You could try to implement that.

@pws1453
Copy link
Contributor Author

pws1453 commented Dec 12, 2021

Me and @bolshoytoaster have been trying to work on this in #25. If anyone else has any ideas, throw em here or at the PR.

@BigweldIndustries
Copy link
Contributor

I believe the error may be due to the fact you have sent too many captchas in one day. I encountered it myself working on a non-headless chromedriver.

@bolshoytoster
Copy link
Contributor

@BigweldIndustries, @pws1453

I believe the error may be due to the fact you have sent too many captchas in one day. I encountered it myself working on a non-headless chromedriver.

If this is the case we could try to make it think we're using a different machine, possibly linking back to #6.

@tommmmyb
Copy link

tommmmyb commented Dec 13, 2021

options = webdriver.ChromeOptions()
options.add_argument('--incognito')  \
driver = webdriver.Chrome(ChromeDriverManager().install(), options=options)

I haven't tried this in headless mode yet, but I haven't had it block me while using this. I think the captcha blocks you based on browser cookies. Switching VPN servers also fixes it, but obviously that's not a great option.

@bolshoytoster
Copy link
Contributor

@tabrown2000

options = webdriver.ChromeOptions()
options.add_argument('--incognito')  \
driver = webdriver.Chrome(ChromeDriverManager().install(), options=options)

I haven't tried this in headless mode yet, but I haven't had it block me while using this. I think the captcha blocks you based on browser cookies. Switching VPN servers also fixes it, but obviously that's not a great option.

This increases the amount of times you can do it before getting locked out, it’s useful but unfortunately it’s not a permanent solution.

Until we find something better we should use this.

@tommmmyb
Copy link

This increases the amount of times you can do it before getting locked out, it’s useful but unfortunately it’s not a permanent solution.

Yeah I've noticed that too. It lets me run it probably 50+ times before it locks me out, then I have to switch VPN servers. My guess is that the captcha is using multiple factors in conjunction to determine when to lock someone out.

@bolshoytoster
Copy link
Contributor

@tabrown2000 if we use this in conjunction with #6 we should have this problem solved.

If we can find some good public proxy servers we can make a array of them to rotate around automatically. That would stop people having to manually switch VPN servers.

@pws1453 pws1453 closed this as completed Dec 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants