51Testing软件测试论坛

标题: 新人求助python运行报错 [打印本页]

作者: wwwanghl    时间: 2018-1-5 12:20
标题: 新人求助python运行报错
新人刚接触python+selenium运行时提示下面错误:版本号python3.6.2
Traceback (most recent call last):
  File "D:\python\lib\site-packages\selenium\webdriver\common\service.py", line 76, in start
    stdin=PIPE)
  File "D:\python\lib\subprocess.py", line 707, in __init__
    restore_signals, start_new_session)
  File "D:\python\lib\subprocess.py", line 992, in _execute_child
    startupinfo)
FileNotFoundError: [WinError 2] 系统找不到指定的文件。

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "D:\python script\test.py", line 3, in <module>
    driver = webdriver.Firefox()
  File "D:\python\lib\site-packages\selenium\webdriver\firefox\webdriver.py", line 148, in __init__
    self.service.start()
  File "D:\python\lib\site-packages\selenium\webdriver\common\service.py", line 83, in start
    os.path.basename(self.path), self.start_error_message)
selenium.common.exceptions.WebDriverException: Message: 'geckodriver' executable needs to be in PATH.

作者: fy975713384    时间: 2018-1-7 04:18
如果是selenium3的话
https://github.com/mozilla/geckodriver/releases下载geckodriver-v0.18.0-win64.zip并解压
将geckodriver.exe放置在了已配置过环境变量path 的python36的安装目录下
作者: 黑盒测试    时间: 2018-1-9 12:55
没配置环境变量




欢迎光临 51Testing软件测试论坛 (http://bbs.51testing.com/) Powered by Discuz! X3.2