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

Breaking API change? #5

Open
fdiotalevi opened this issue Nov 5, 2024 · 6 comments
Open

Breaking API change? #5

fdiotalevi opened this issue Nov 5, 2024 · 6 comments

Comments

@fdiotalevi
Copy link

I have been using the library for a few months without issues, but since a week ago I can't anymore. Even the test script in the README will not work

How to reproduce

  1. Use the test script in the README
import chrono24

for listing in chrono24.query("Rolex DateJust").search():
    print(listing) 
  1. Run it and obtain
> python3 test.py  
Retrying request... Attempt #1.
Retrying request... Attempt #2.
Retrying request... Attempt #3.
Retrying request... Attempt #4.
@irahorecka
Copy link
Owner

Thanks for bringing this up. It seems Chrono24 has implemented Cloudflare’s anti-scraping feature to block non-browser requests. If the issue persists, I can explore using Selenium as a workaround. While it could be effective, it may be more cumbersome to use.

@fdiotalevi
Copy link
Author

Makes sense. Is there a workaround to be able to use the library?

@irahorecka
Copy link
Owner

irahorecka commented Nov 7, 2024

Not at the moment, unfortunately. If you are able to get a hold of the HTML content, you should be able to fetch listings using this private method

import chrono24

# listing_html is your beautifulsoup4 object
standard_listing_dict = chrono24.query._get_standard_listing_as_json(listing_html)
detailed_listing_dict = chrono24.query._get_detailed_listing_as_json(listing_html)

@irahorecka
Copy link
Owner

Cloudflare Issues – Temporary Workaround

Thanks to @davidiola for suggesting a potential solution to the Cloudflare problems.

Use FlareSolverr, an open-source proxy. Spin up the Docker container as described in their documentation, route your requests through it, and retrieve the relevant HTML.

I haven’t tested this yet. It may work as a stopgap. A more permanent fix is under consideration.

If anyone tries it, post your feedback here.

@paF512
Copy link

paF512 commented Dec 3, 2024

Hey guys, on my side the error persist and to be honest I'm not very familiar with FlareSolverr, could anyone help with this privat methode please, not sure how to use it :

Not at the moment, unfortunately. If you are able to get a hold of the HTML content, you should be able to fetch listings using this private method

import chrono24

# listing_html is your beautifulsoup4 object
standard_listing_dict = chrono24.query._get_standard_listing_as_json(listing_html)
detailed_listing_dict = chrono24.query._get_detailed_listing_as_json(listing_html)

Many thanks :)

@trungkien20020428
Copy link

Use FlareSolverr, an open-source proxy. Spin up the Docker container as described in their documentation, route your requests through it, and retrieve the relevant HTML.

FlareSolverr still can not resolve the Cloudflare turnstile at less in the main branch.

They have some PRs to resolve it, they already have the docker image build of this PR, so we should try it.
FlareSolverr/FlareSolverr#1272
FlareSolverr/FlareSolverr#1300

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