搭建 Selenium自动化测试环境:Selenium+Python 运行了一个测试脚本,出现以下错误。求解

Traceback(mostrecentcalllast):File"C:\Users\Administrator.SC-201607151621\AppData\Loc... Traceback (most recent call last):
File "C:\Users\Administrator.SC-201607151621\AppData\Local\Programs\Python\Python35\lib\site-packages\selenium\webdriver\common\service.py", line 74, in start
stdout=self.log_file, stderr=self.log_file)
File "C:\Users\Administrator.SC-201607151621\AppData\Local\Programs\Python\Python35\lib\subprocess.py", line 947, in __init__
restore_signals, start_new_session)
File "C:\Users\Administrator.SC-201607151621\AppData\Local\Programs\Python\Python35\lib\subprocess.py", line 1224, in _execute_child
startupinfo)
FileNotFoundError: [WinError 2] 系统找不到指定的文件。

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:/Users/Administrator.SC-201607151621/AppData/Local/Programs/Python/Python35/2.py", line 4, in <module>
driver = webdriver.Firefox()
File "C:\Users\Administrator.SC-201607151621\AppData\Local\Programs\Python\Python35\lib\site-packages\selenium\webdriver\firefox\webdriver.py", line 140, in __init__
self.service.start()
File "C:\Users\Administrator.SC-201607151621\AppData\Local\Programs\Python\Python35\lib\site-packages\selenium\webdriver\common\service.py", line 81, in start
os.path.basename(self.path), self.start_error_message)
selenium.common.exceptions.WebDriverException: Message: 'geckodriver' executable needs to be in PATH.
展开
 我来答
匿名用户
2017-02-22
展开全部
去搜索下载geckodriver.exe 放到C:\Python27\Scripts目录下
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式