Python Requests.py重定向URL

Python Requests.py重定向URL,python,beautifulsoup,python-requests,Python,Beautifulsoup,Python Requests,当您转到该站点时,您将被重定向到 我想使用请求输入该搜索链接,然后返回重定向到的url 下面是我的代码: import requests from bs4 import BeautifulSoup sitename = "https://www.jimmyjazz.com/search?keywords=11468285" response = requests.get(sitename, allow_redirects=True) print(response.url) 但它仍然返回原始ur

当您转到该站点时,您将被重定向到

我想使用请求输入该搜索链接,然后返回重定向到的url

下面是我的代码:

import requests
from bs4 import BeautifulSoup
sitename = "https://www.jimmyjazz.com/search?keywords=11468285"
response = requests.get(sitename, allow_redirects=True)
print(response.url)
但它仍然返回原始url:

PS C:\Users\jokzc\Desktop\python\learning requests> py test2.py
https://www.jimmyjazz.com/search?keywords=11468285

我将如何附加代码来修复它?谢谢:)

这实际上并没有将
302
重定向代码发回。我在postman中执行了相同的HTTP GET调用,它似乎返回了
200
OK响应:

chrome开发工具也是如此,关注网络流量:

我认为在他们的JavaScript代码中有一个新的url。我没有通过整个JS堆栈跟踪来证明这一点,但这是我最好的猜测