davegri
davegri

Reputation: 2286

Check what URL was returned using requests library

My problem is pretty simple.

If I visit the following url: https://pixabay.com/en/editors_choice/?media_type=photo&pagi=999

The url I actually end up in is: https://pixabay.com/en/editors_choice/?media_type=photo&pagi=

Using the following code, how do I check what URL I ended up in?

response = requests.get(page_url, headers=headers)

Upvotes: 2

Views: 56

Answers (1)

miles82
miles82

Reputation: 6794

It's in response.url, see the docs.

Upvotes: 1

Related Questions