Skip to content

Failing to retrieve BBC webpages with fetch #3400

Answered by mcollina
dzx-dzx asked this question in Q&A
Discussion options

You must be logged in to vote

They are doing some kind of user-agent sniffing, and they don't like ours. This will work:

await fetch("https://www.bbc.com/news/articles/cw0ygnyxgnqo", { headers: { 'User-Agent': 'curl/8.4.0' } })

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@dzx-dzx
Comment options

@mcollina
Comment options

@dzx-dzx
Comment options

Answer selected by dzx-dzx
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants