python selenium 执行完毕关闭chromedriver进程

#OS是我们操作dos系统时需要引入的库

import os
#杀死这个chromedriver进程,因为每次启动都会打开,所以需要kill,这里用的chrome浏览器,打开方式时chromedriver.exe。需要放在代码同一目录下

os.system("taskkill /f /im chromedriver.exe")

os.system('taskkill /im chromedriver.exe /F')
os.system('taskkill /im chrome.exe /F')



 

转载于:https://www.cnblogs.com/sammisammi/p/10913388.html