Answer the question
In order to leave comments, you need to log in
How to avoid redirects when scraping a site?
I am parsing a website in python using BF4. All pages except one are parsed without problems. But the problematic page cannot be read due to the fact that after accessing this page, it redirects me to the main one.
Is there a script for this? And how in theory to get around this redirect?
Answer the question
In order to leave comments, you need to log in
In short - no way)
The very essence of the redirect is this. A page is a link to another page
But if you need to catch redirects, you can use "status_code"
r = requests.get(url)
if r.status_code in [301, 302]:
# переадресация
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question