How to change URL in Selenium without opening new tab (python)? How to change URL in Selenium without opening new tab (python)? selenium selenium

How to change URL in Selenium without opening new tab (python)?


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/#