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

403 when fetching rankings #2

Open
programerr01 opened this issue Jul 21, 2024 · 4 comments
Open

403 when fetching rankings #2

programerr01 opened this issue Jul 21, 2024 · 4 comments

Comments

@programerr01
Copy link

It appears that there's anti-bot protection enabled by cloudflare for /api/ranking/* page
image
image

@TISHARP
Copy link

TISHARP commented Jul 22, 2024

Yes I've found this problem is for the most part resolved by Selenium.
I haven't created a way to solve the Cloud Flair with Selenium, however using Selenium does help improve the fetching of the data making us able to capture 100% of the data (or close to it).

One down side of using Selenium is you have to install the chrome web-driver (or another web-driver) before you are able to use it...

For that reason I was thinking of having a secondary file for selenium use... What do you think about that?

@programerr01
Copy link
Author

@TISHARP using selenium isn't very effective , atleast in this context. Selenium makes more sense in situation where there's dynamic data or complex dynamic html rendering on client side. This endpoint provides well formatted json response so would be better if direct http request could be made.

There are few libraries for bypassing cloudflare but so far i couldn't make them work with the specified endpoint

@rahulharpal1603
Copy link

https://github.com/baoliay2008/lccn_predictor

Hi, you can try to refer to the codebase of this repo. I think they have managed to bypass Cloudflare. They are using Python and crawler.

@programerr01
Copy link
Author

Hii @rahulharpal1603 , i am not sure what libraries they have used but i personally used cloudscrape and it worked
Repo

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