Selenium失败,错误为:服务geckodriver意外退出。状态代码为:2

2024-04-30 01:13:50 发布

您现在位置:Python中文网/ 问答频道 /正文

我在用

  • 硒3.0.1
  • Python2.7.12
  • 火狐50

我已经在PATH中设置了geckodriver的路径,但是在运行测试时仍然会出现以下错误:

selenium.common.exceptions.WebDriverException: Message: Service geckodriver unexpectedly exited. Status code was: 2

此外,在geckodriver.log的主目录中,将显示以下内容:

Usage:
    geckodriver [OPTIONS]
geckodriver: Unknown option --port

Tags: path路径messagestatusselenium错误servicecode