undetected-chromedriver
undetected-chromedriver copied to clipboard
Why manually closing the program browser doesn't close automatically
Why manually closing the program browser doesn't close automatically how do i do it
If you manually interrupt your script how the code to quit the driver and close the browser would be executed ?
@afan441524641 To answer you question:
Like @sebdelsol has mentioned in another issue, https://github.com/ultrafunkamsterdam/undetected-chromedriver/issues/789#issuecomment-1222283514
The reason for this is that every time you terminate the script using your IDE, chromedriver does not properly terminate, in many cases resulting in memory leaks. You can view a temp folder in your explorer containing past executable chromedrivers you have used when running your scripts. They are safe to delete:
(C:\Users\username\AppData\Roaming\undetected_chromedriver)
Make sure your script is running the function driver.quit()
before terminating.
You can use this snippet to monitor this event:
print("Terminating Process...")
driver.quit() # terminates chromedriver process
print("Process Terminated.")