Reputation: 24731
I'm in a loop, navigating paged search results. The next button never disappears. I want to keep clicking it until the URL no longer changes. I imagine I will need a requests session? I want to do something like this:
new_url = soup.find("blahblah")['href']
if session.current_url == new_url:
return
Upvotes: 7
Views: 10231
Reputation: 24731
On the response object, there is a .url
property that you can use to access the URL of the current page.
Upvotes: 11