User
User

Reputation: 24751

'WebDriver' object has no attribute 'navigate'

Trying to use driver.navigate().to('https://example.com')

Error:

AttributeError: 'WebDriver' object has no attribute 'navigate'

Surely it does - it's mentioned all over this site.

I don't want to use get() because I want cookies to persist for the session.

Upvotes: 2

Views: 9810

Answers (1)

PDHide
PDHide

Reputation: 19979

driver.navigate().to('https://example.com')

is Java , in python only get is there

it uses same browser session and cookies ,

you can use page loading strategies if ypu dont want to wait for page load

Also the answer you tagged is wrong ,

https://www.selenium.dev/selenium/docs/api/java/org/openqa/selenium/WebDriver.html#navigate()

navigate WebDriver.Navigation navigate() An abstraction allowing the driver to access the browser's history and to navigate to a given URL. Returns: A WebDriver.Navigation that allows the selection of what to do next

The only use of navigate is to go-to history for navigating back and forward it doesn't have anything to do with cookies or session

Upvotes: 2

Related Questions