如何在ubuntu上安装python3 selenium的firefoxdriver webdriver?

shi*_*wal 8 python django ubuntu selenium

我在Ubuntu 16.04上安装了python3-selenium apt包.在安装时,收到了一条消息:

Suggested packages:
  chromedriver firefoxdriver
The following NEW packages will be installed:
  python3-selenium
Run Code Online (Sandbox Code Playgroud)

当我尝试在python3-django中运行测试用例时,我收到以下错误:

FileNotFoundError: [Errno 2] No such file or directory: '/usr/lib/firefoxdriver/webdriver.xpi'
Run Code Online (Sandbox Code Playgroud)

我在Ubuntu存储库中搜索了包名为firefoxdriver但没有存在.

任何有关安装webdrivers的帮助表示赞赏.

Ala*_*air 4

我不确定安装python3-selenium软件包后如何安装 Firefox Webdriver。

您可以使用 pip 进行安装,最好是在虚拟环境中。

如果您安装了 Firefox 并且在虚拟环境中运行pip install selenium,那么您应该可以开始了。