2

I saw some .navigate() functions to do that in java but it's not in python.

So, how can I just change the URL of currently opened window without opening a new tab?

0

1 Answer 1

2

Just call driver.get('yourURL') again. Example:

driver = webdriver.Chrome()
driver.get('https://google.com')
print(driver.current_url)
driver.get('https://gmail.com/')
print(driver.current_url)

Output:

https://www.google.com/
https://www.google.com/intl/id/gmail/about/#
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.