splinter
splinter copied to clipboard
quit () can not completely quit chrome when use <ctrl-c> to break script in win10
When I use ctrl-c to exit the script, quit() can not completely quit chrome, the process also left two.
If it is overtime exit, no problem.
from splinter.browser import Browser
import time
b = Browser('chrome', headless=True)
print("loop")
try:
count = 0
while True:
time.sleep(1)
count += 1
if count > 10:
break
except KeyboardInterrupt:
print("KeyboardInterrupt")
print("quit")
b.quit()
chrome v62 ChromeDriver 2.35.528161 Python 3.6.3 os win10 x64
This doesn't appear to be a splinter issue, but https://stackoverflow.com/questions/27495376/catching-keyboardinterrupt-without-closing-selenium-webdriver-sessions-in-pyth is probably in the right direction.