M
M
MaxEpt2015-10-03 17:43:37
Python
MaxEpt, 2015-10-03 17:43:37

Why can the server return a 307 error when parsing a site in python?

Here is the error itself:
urllib.error.HTTPError: HTTP Error 307: The HTTP server returned a redirect error that would lead to an infinite loop.
Here is the function that receives html
def getHtml(url):
print(url)
response = urllib.request.urlopen(url)
return response.read()
Google gives advice to do something with cookies, but it doesn't work.
Can anyone help? there is a lot of content, show the customer tomorrow, only the working script will save )))

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dimonchik, 2015-10-03
@MaxEpt

replace getting page with this library docs.python-requests.org/en/latest

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question