Mauro Gentile
Mauro Gentile

Reputation: 1511

Navigating to a new page through Selenium in Python

How do I navigate to another webpage using the same driver with Selenium in python? I do not want to open a new page. I want to keep on using the same driver. I thought that the following would work:

driver.navigate().to("https://support.tomtom.com/app/contact/")

But it doesn't! Navigate seems not to be a 'WebDriver' method

Upvotes: 1

Views: 15208

Answers (2)

Mr. Blue
Mr. Blue

Reputation: 230

To navigate to a webpage you just write

driver.get(__url__)

you can do this in your program multiple times

Upvotes: 5

undetected Selenium
undetected Selenium

Reputation: 193348

The line of code which you have tried as :

driver.navigate().to("https://support.tomtom.com/app/contact/")

It is a typical Java based line of code.

However as per the currect Python API Docs of The WebDriver implementation navigate() method is yet to be supported/implemented.

Indtead, you can use the get(url) method instead which is defined as :

def get(self, url):
    """
    Loads a web page in the current browser session.
    """
    self.execute(Command.GET, {'url': url})

Upvotes: 2

Related Questions