How can I close the browser window without closing the browser in webdriver? I have something like
from selenium import webdriver
driver = webdriver.Firefox()
driver.get("http://www.google.com")
# so far so good
driver.close()
# quits the app altogether :(
driver.get("http://www.google.com")
# doesn't do anything
Of course I can do driver = webdriver.Firefox() again at this point, but is there a way to just close the window without quitting the browser? Thanks!
Use driver.get(""); instead of driver.close();.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With