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

A short workaround for the new Immoscout captchas #633

Closed
JoGruen opened this issue Sep 13, 2024 · 2 comments
Closed

A short workaround for the new Immoscout captchas #633

JoGruen opened this issue Sep 13, 2024 · 2 comments

Comments

@JoGruen
Copy link

JoGruen commented Sep 13, 2024

Hi,
recently I've started using flathunter - thanks for the great project. As it currently does not seem to work with the captcha system of immoscout I've included the capsolver extension for chrome. It works very well if the captcha is refreshed after loading. This can easily being done via:

if "kein Roboter" in driver.page_source:
            try:
                time.sleep(5)
                host_element = self.get_driver_force().find_element(By.ID, "captcha-container")
                first_child = host_element.find_element(By.CSS_SELECTOR, '#captcha-container > awswaf-captcha')
                shadow_root = self.get_driver().execute_script('return arguments[0].shadowRoot', first_child)
                btn = shadow_root.find_element(By.ID, "amzn-btn-refresh-internal")
                btn.click()
                time.sleep(5)
            except: 
                logger.error("Unable to find captcha element")
                pass

As I do not consider this as a good solution I haven't created a PR for this. But maybe it is still interesting for someone.

If I find more time I probably will include capsolver in a proper way.

See u in my new flat :)

@devHaitham481
Copy link

thanks for this @JoGruen but where am I supposed to write that piece of code ?

@codders
Copy link

codders commented Dec 16, 2024

Thanks for the workaround code. We've integrated capmonster support for the immoscout captchas in #634 - hopefully that's a more sustainable solution. @devHaitham481 you're welcome to try with Capmonster and open an issue again here if you have a problem (though not that we can't promise that it will work for you - no money back guarantee!).

@codders codders closed this as completed Dec 16, 2024
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

3 participants