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

fix: Update user-agent #3526

Closed

Conversation

ndragon798
Copy link

@ndragon798 ndragon798 commented Apr 29, 2024

What type of PR is this?

  • bug

What this PR does / why we need it: Update user-agent to bypass block on thekitchn.com

Which issue(s) this PR fixes: #3524

Tested via spinning it up in docker-compose

@ndragon798 ndragon798 marked this pull request as ready for review April 29, 2024 00:37
@ndragon798 ndragon798 changed the title Draft: Update user-agent fix: Update user-agent Apr 29, 2024
@boc-the-git
Copy link
Collaborator

Worth noting @hay-kot has a very similar PR: #3457
It looks like it'd be more future-proof, though on the face of it he hasn't finished testing it.

@ndragon798
Copy link
Author

I'm looking at adding a more robust UA rotation method but I wanted a simple fix for now. There quite a few api's that we could pull a list of current UAs automatically and just rotate through those so we don't get an 1 user-agent banned.

@hay-kot
Copy link
Collaborator

hay-kot commented Apr 29, 2024

#3457 - Is tested. (failing CI is unrelated to PR)

I'm looking at adding a more robust UA rotation method but I wanted a simple fix for now. There quite a few api's that we could pull a list of current UAs automatically and just rotate through those so we don't get an 1 user-agent banned.

Is an interesting idea. If you implement this, I'd suggest letting it be user configurable either by a comma separated list via ENV variable or a JSON file or something and then using a factory pattern or something to pick one at random which one to use.

@ndragon798
Copy link
Author

Closing the PR since the other one was merged.

@ndragon798 ndragon798 closed this Apr 29, 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

Successfully merging this pull request may close these issues.

[SCRAPER] - www.colruyt.be/nl/lekker-koken recipe scraping returns failed to scrape url
3 participants