想请问一下python关于网页重定向问题的解决方法

正常访问“https://new.qq.com/omn/20210315/20210315A080UK00”网址时,会闪现新闻正常页面后转跳至"https://www.qq.com/babygohome/?pgv_ref=apub"页面,并在7秒后返回首页“https://www.qq.com/?pgv_ref=404”。

url = "https://new.qq.com/omn/20210315/20210315A080UK00"
response = requests.get(url, headers=headers, allow_redirects=True)
print(response.url)

请问各位大神,为什么print出来的不是转跳以后的网址,仍旧是https://new.qq.com/omn/20210315/20210315A080UK00呢?应该如何获取到"https://www.qq.com/babygohome/?pgv_ref=apub"页面呢?

 

是通过js脚本跳转到"https://www.qq.com/babygohome/?pgv_ref=apub"页面,你可以分析response.text的特征来判断这个页面是不是404了