I'm trying to get the redirects of some Wikipedia pages, and it's happening something curious to me.
If i make:
>>> request = requests.get("https://en.wikipedia.org/wiki/barcelona", allow_redirects=True)
>>> request.url
u'https://en.wikipedia.org/wiki/Barcelona'
>>> request.history
[<Response [301]>]
As you can see, the redirection is correct and I have same url in browser that in Python.
But if I try:
>>> request = requests.get("https://en.wikipedia.org/wiki/Yardymli_Rayon", allow_redirects=True)
>>> request.url
u'https://en.wikipedia.org/wiki/Yardymli_Rayon'
>>> request.history
[]
And in the browser I see that the URL has changed to: https://en.wikipedia.org/wiki/Yardymli_District
Anyone knows how to solve it?