Checking 301 Redirects with Python Requests

preview_player
Показать описание
In this video, I explain how to use the Python requests library to check for 301 redirects.
Рекомендации по теме
Комментарии
Автор

Man, u helped me so much, my url is "http", and when u said needs something with "https", i was think to see if i was using "https" too, and it was that. I was like 6 hours doing this code, thank you xD.

dunhaqueijosmila
Автор

Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python2.7/site-packages/requests/sessions.py", line 476, in get
return self.request('GET', url, **kwargs)
File "/usr/lib/python2.7/site-packages/requests/sessions.py", line 464, in request
resp = self.send(prep, **send_kwargs)
File "/usr/lib/python2.7/site-packages/requests/sessions.py", line 602, in send
history = [resp for resp in gen] if allow_redirects else []
File "/usr/lib/python2.7/site-packages/requests/sessions.py", line 114, in resolve_redirects
raise TooManyRedirects('Exceeded %s redirects.' % self.max_redirects)
Exceeded 30 redirects.

kumarrajamaddala