问题:
在chentos7中安装了selenium和chrome后启动程序报错:
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.WebDriverException: Message: unknown error: Chrome failed to start: exited abnormally
(unknown error: DevToolsActivePort file doesn't exist)
(The process started from chrome location /usr/bin/google-chrome is no longer running, so ChromeDriver is assuming that Chrome has crashed.)
原因:
1.chromedriver没有安装
2.chromedriver的版本和chrom浏览器的版本不对应
解决办法:
1.在 https://blog.csdn.net/huilan_same/article/details/51896672 网站中找到chrom浏览器和chromedriver对应的版本号
2.在 http://chromedriver.storage.googleapis.com/index.html 网站中下载chromedriver并放到对应的python环境(虚拟环境)下的.../site-packages目录下
完毕!