Get Current URL using Selenium WebDriver (Python)

Get Current URL using Selenium WebDriver (Python)

To get the current page's URL, use the WebDriver attribute current_url like so:

url = self.driver.current_url
print(url);

This example will store the URL into a variable and print it to the console.


See Working Example



Using Java

Leave a reply

Your email address will not be published. Required fields are marked*

CAPTCHA
This question is for testing whether or not you are a human visitor and to prevent automated spam submissions.