I want to close all open tabs (browser windows) without actually closing the driver, because I want to keep using it.
driver.close()
will just close the focused tab.
driver.quit()
will close them all but also quit the driver.
I thought about using driver.quit()
and then re-opening the driver. But it does not seem very clean. Or maybe it is super clean, but also a slow thing to do.
Note: Using Firefox via geckodriver
How can I approach this?