I'm trying to get the current url after a series of navigations in Selenium. I know there's a command called getLocation for ruby, but I can't find the syntax for Python.
This question is related to
python
selenium
selenium-webdriver
According to this documentation (a place full of goodies:)):
driver.current_url
or, see official documentation: https://seleniumhq.github.io/docs/site/en/webdriver/browser_manipulation/#get-current-url
Another way to do it would be to inspect the url bar in chrome to find the id of the element, have your WebDriver click that element, and then send the keys you use to copy and paste using the keys common function from selenium, and then printing it out or storing it as a variable, etc.
Selenium2Library has get_location():
import Selenium2Library
s = Selenium2Library.Selenium2Library()
url = s.get_location()
Source: Stackoverflow.com