how to close windows in selenium python without quitting the browser

Solutions on MaxInterview for how to close windows in selenium python without quitting the browser by the best coders in the world

showing results for - "how to close windows in selenium python without quitting the browser"
Mariangel
08 Jan 2021
1for handle in driver.window_handles:
2    driver.switch_to.window(handle)
3    driver.close()
4