We can get the current URL of a page with Selenium webdriver. The method current_url is available which obtains the present page URL and then we can print the result in the console.
s = driver.current_url
Let us find the URL of the page presently navigated and we shall get https://www.tutorialspoint.com/index.htm as the output.
from selenium import webdriver driver = webdriver.Chrome(executable_path="C:\\chromedriver.exe") driver.implicitly_wait(0.5) driver.get("https://www.tutorialspoint.com/index.htm") #identify current URL with current_url l= driver.current_url print(Current URL is: " + l) driver.close()