In my program I got something like this:
driver = webdriver.Chrome(options=Options()) #calling the driver
driver.get(website) #opening the website
try:
while True:
do_something() #Here I do a couple of things
except KeyboardInterrupt:
#When I'm done with the while loop above(the goal is to be able to stop at any point of the loop) I use ctrl+c
pass
#Here the program continues but selenium closes the window even though I didn't call for driver.quit().
While it successfully stops the while loop and don't end the program itself, selenium closes the window browser. Is there a way to prevent selenium from closing the window?