Is there a way to retrieve the url from the webbrowser search bar?

Viewed 26

For example, if I enter in the search bar: "https://www.yelp.com/search?find_desc=tacobell", the url changes to "https://www.yelp.com/search?find_desc=tacobell&find_loc=Fort+Worth%2C+TX". I'm wondering is their a way to grab that url with python. example

1 Answers

yes try

browser.current_url
url = "https://www.yelp.com/search?find_desc=tacobell"
browser.get(url)
print(browser.current_url)

prints -

https://www.yelp.com/search?find_desc=tacobell&find_loc=San+Francisco%2C+CA
Related