How to get current_url using Selenium in Python? Improve Improve Like Article Like Save Share Report While doing work with selenium many URL get opened and redirected in order to keeping track of URL current_url method is used. The current_url method is used to retrieve the URL of the webpage the user is currently accessing. It gives the URL of the current webpage loaded by the driver in selenium. URL : URL is the abbreviation of Uniform Resource Locator and is defined as the global address of documents and other resources on the World Wide Web, for example, to visit GeeksforGeeks website, you’ll go to the URL https://www.geeksforgeeks.org/ . Syntax : driver.current_url Argument : It takes no argument. Return value : It return the URL in string format. Code 1: # Importing webdriver from selenium from selenium import webdriver # Here chrome webdriver is used driver = webdriver.Chrome() # URL of the website url = "https://www.geeksforgeeks.org/" # Opening the URL driver.get(url) # Getting current URL get_url = driver.current_url # Printing the URL print(get_url) Output : https://www.geeksforgeeks.org/ Code 2: # Importing webdriver from selenium from selenium import webdriver # Here chrome webdriver is used driver = webdriver.Chrome() # URL of the website url = "https://www.geeksforgeeks.org/" # Getting current URL get_url = driver.current_url # Printing the URL print(get_url) # Opening the URL driver.get(url) # Getting current URL get_url = driver.current_url # Printing the URL print(get_url) Output : data:, https://www.geeksforgeeks.org/ Note: Here “data:, ” is printed because at that time no webpage is opened. Last Updated : 06 Mar, 2020 Like Article Save Article Previous How to handle Frames/iFrames in Selenium with Python Next Python - Pairs with multiple similar values in dictionary Share your thoughts in the comments Add Your Comment Please Login to comment... Similar Reads current_url driver method - Selenium Python Get all text of the page using Selenium in Python How to get title of a webpage using Selenium in Python? Navigating links using get method - Selenium Python Get contents of entire page using Selenium How to get text of a tag in selenium - Python? Selenium Base Mini Project Using Python Python | SMS Bomber using Selenium Close specific Web page using Selenium in Python Download Instagram Posts Using Python Selenium module Like R rakshitarora Follow Article Tags : Python-selenium Python Web Technologies Practice Tags : python