获取请求历史记录的日期/时间

2024-04-20 09:33:16 发布

您现在位置:Python中文网/ 问答频道 /正文

我有下面的脚本,其中拉所有网址重定向历史。有没有办法让我知道这些重定向生效的日期和时间?你知道吗

r = requests.get(url)
for h in r.history:
    print (h.url)
print (r.url)

Tags: in脚本urlforget时间历史requests