How to get current_url using Selenium in Python?ReadDiscussCoursesPracticeImprove Article ImproveSave Article SaveLike Article LikeWhile 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 seleniumfrom selenium import webdriver # Here chrome webdriver is useddriver = webdriver.Chrome() # URL of the website url = "https://www.geeksforgeeks.org/" # Opening the URLdriver.get(url) # Getting current URLget_url = driver.current_url # Printing the URLprint(get_url)Output :https://www.geeksforgeeks.org/Code 2:# Importing webdriver from seleniumfrom selenium import webdriver # Here chrome webdriver is useddriver = webdriver.Chrome() # URL of the website url = "https://www.geeksforgeeks.org/" # Getting current URLget_url = driver.current_url # Printing the URLprint(get_url) # Opening the URLdriver.get(url) # Getting current URLget_url = driver.current_url # Printing the URLprint(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, 2020Like Article Save Article Please Login to comment...Similar Readscurrent_url driver method - Selenium PythonGet all text of the page using Selenium in PythonHow to get title of a webpage using Selenium in Python?Navigating links using get method - Selenium PythonGet contents of entire page using SeleniumHow to get text of a tag in selenium - Python?Selenium Base Mini Project Using PythonPython | SMS Bomber using SeleniumClose specific Web page using Selenium in PythonNon blocking wait in selenium using PythonRelated TutorialsPandas AI: The Generative AI Python LibraryOpenAI Python API - Complete GuidePython for Kids - Fun Tutorial to Learn Python ProgrammingData Analysis TutorialFlask Tutorial LikePreviousHow to Get Local IP Address of System using PHP ?Next Python - Pairs with multiple similar values in dictionaryArticle Contributed By :Rrakshitarorarakshitarora FollowVote for difficultyEasy Normal Medium Hard ExpertArticle Tags :Python-seleniumPythonWeb TechnologiesPractice Tags :pythonReport Issue