1# driver.close() closes one tab
2# driver.quit() quits the session
3
4# this closes all tabs but doesnt quit the session as a whole
5alltabs = driver.window_handles
6for i in range(len(alltabs)):
7 driver.switch_to.window(alltabs[i])
8 driver.close();sleep(1)