python.错误记录 selenium.common.exceptions.WebDriverException
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了python.错误记录 selenium.common.exceptions.WebDriverException相关的知识,希望对你有一定的参考价值。
错误代码:
Traceback (most recent call last): browser = webdriver.Chrome(‘C:\Program Files (x86)\Google\Chrome\Application\chrome.exe‘)
File "D:\Python27\lib\site-packages\selenium\webdriver\chrome\webdriver.py", line 62, in __init__
self.service.start()
File "D:\Python27\lib\site-packages\selenium\webdriver\common\service.py", line 96, in start
self.assert_process_still_running()
File "D:\Python27\lib\site-packages\selenium\webdriver\common\service.py", line 109, in assert_process_still_running
% (self.path, return_code)
selenium.common.exceptions.WebDriverException: Message: Service C:\Program Files (x86)\Google\Chrome\Application\chrome.exe unexpectedly exited. Status code was: 0
解决:
browser = webdriver.Chrome() #括号内输入chromedriver的路径
或者配置环境变量Path
以上是关于python.错误记录 selenium.common.exceptions.WebDriverException的主要内容,如果未能解决你的问题,请参考以下文章