python selenium爬虫: chromedriver运行卡顿
爬虫运行一段时间后崩溃,电脑卡顿
python爬虫用selenium+chrome来获取网页cookie,本来运行好好的,结果第二天发现电脑严重卡顿,爬虫程序假死。在打开任务管理器后发现CPU高达99%,大量chromedriver、webdriver等进程残留,全部结束任务后恢复正常。
解决方法:
代码
window系统在代码里加上kill即可 代码
.
// import os
os.system('taskkill /im chrome.exe /F')
os.system('taskkill /im chromedriver.exe /F')
os.system('taskkill /im webdriver.exe /F')