Reputation: 201
I have the below script which pulls all URL redirect history. Is there a way I can get the date and time of when these redirects were effected?
r = requests.get(url)
for h in r.history:
print (h.url)
print (r.url)
Upvotes: 2
Views: 403
Reputation: 541
You can get from the headers of the history objs. like.
r = requests.get(url)
for h in r.history:
print (h.url)
print (h.headers.get("date"))
print (r.url)
Upvotes: 4