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/ .
It takes no argument.
Return value :
It return the URL in string format.
Note: Here “data:, ” is printed because at that time no webpage is opened.
Attention geek! Strengthen your foundations with the Python Programming Foundation Course and learn the basics.
To begin with, your interview preparations Enhance your Data Structures concepts with the Python DS Course.
- How to get title of a webpage using Selenium in Python?
- Navigating links using get method - Selenium Python
- Selenium Base Mini Project Using Python
- Python | SMS Bomber using Selenium
- Non blocking wait in selenium using Python
- Python | Automating Happy Birthday post on Facebook using Selenium
- How to access popup login window in selenium using Python
- Python | Automate Google Search using Selenium
- Python - Opening links using Selenium
- Flight-price checker using Python and Selenium
- How to take screenshot using Selenium in Python ?
- Search Google Using Python Selenium
- Writing Tests using Selenium Python
- How to move back and forward in History using Selenium Python ?
- Twitter Automation using Selenium Python
- Scraping COVID-19 statistics using Python and Selenium
- Gmail Login using Python Selenium
- Cloud-based Automation using Selenium in Python and BrowserStack
- Check High School Result using Selenium in Python
- Check 12th Class Result Using Selenium in Python
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.