使用
要获取真实url地址就两行代码
baidu_url = requests.get(url=url, headers=headers, allow_redirects=False)
real_url = baidu_url.headers['Location']
要获取真实url地址就两行代码
baidu_url = requests.get(url=url, headers=headers, allow_redirects=False)
real_url = baidu_url.headers['Location']