How to get current_url using Selenium in Python? Last Updated : 06 Mar, 2020 Summarize Comments Improve Suggest changes Share Like Article Like 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: Python3 # 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: Python3 # 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. Comment More infoAdvertise with us Next Article How to get current_url using Selenium in Python? R rakshitarora Follow Improve Article Tags : Python Python-selenium Practice Tags : python Similar Reads current_url driver method - Selenium Python Seleniumâs Python Module is built to perform automated testing with Python. Selenium Python bindings provides a simple API to write functional/acceptance tests using Selenium WebDriver. To open a webpage using Selenium Python, checkout â Navigating links using get method â Selenium Python. Just bein 2 min read How to Locate Elements using Selenium Python? Selenium: is an open-source tool that automates web browsers. It provides a single interface that lets you write test scripts in programming languages like Ruby, Java, NodeJS, PHP, Perl, Python, and C#, among others. I personally prefer Python as itâs very easy to write code in python. A browser-dri 3 min read How to get text of a tag in selenium - Python? Selenium is a powerful tool for controlling web browsers through programs and performing browser automation. It is functional for all browsers, works on all major OS and its scripts are written in various languages i.e Python, Java, C#, etc, we will be working with Python. In this article, we will w 1 min read Navigating links using get method - Selenium Python Selenium's Python module allows you to automate web testing using Python. The Selenium Python bindings provide a straightforward API to write functional and acceptance tests with Selenium WebDriver. Through this API, you can easily access all WebDriver features in a user-friendly way. This article e 2 min read Get all text of the page using Selenium in Python As we know Selenium is an automation tool through which we can automate browsers by writing some lines of code. It is compatible with all browsers, Operating systems, and also its program can be written in any programming language such as Python, Java, and many more. Selenium provides a convenient A 3 min read Like