码迷,mamicode.com
首页 > 编程语言 > 详细

python.错误记录 selenium.common.exceptions.WebDriverException

时间:2017-09-30 21:57:22      阅读:1206      评论:0      收藏:0      [点我收藏+]

标签:配置环境变量   path   proc   site   self   python2   lib   sel   common   

错误代码:

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

标签:配置环境变量   path   proc   site   self   python2   lib   sel   common   

原文地址:http://www.cnblogs.com/nero3/p/7616138.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!