'Get params from response with Python

When I enter certain page with my browser, some params are added. For example the URL changes from https://www.mypage.com/subpage to https://www.mypage.com/subpage/productId=12345.

I want to do a request to this url and get the url with the param (productId=12345) added. I have tried to get the url from the response, but it returns the same url, and to get the history, but there is no redirection.

url = "https://www.mypage.com/subpage"
r = requests.get(url)
print(r.history)
#[]


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source