【问题标题】:How to add firefox to system PATH on Linux instance at Amazon Web Service?如何在 Amazon Web Service 的 Linux 实例上将 firefox 添加到系统 PATH?
【发布时间】:2016-09-02 23:23:08
【问题描述】:

这是一个幼稚的问题,但是如何将 firefox 添加到 Amazon Web Service Linux 实例上的系统 PATH 中?我应该澄清一下,我将 firefox 安装到 /home/firefox 而不是 /usr/bin。谢谢!我目前在尝试加载 firefox webdriver 时出现以下错误(在导入 selenium 之后):

>>> driver = webdriver.Firefox()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python2.7/site-packages/selenium/webdriver/firefox/webdriver.py", line 64, in __init__
    self.binary = capabilities.get("binary") or FirefoxBinary()
  File "/usr/local/lib/python2.7/site-packages/selenium/webdriver/firefox/firefox_binary.py", line 47, in __init__
    self._start_cmd = self._get_firefox_start_cmd()
  File "/usr/local/lib/python2.7/site-packages/selenium/webdriver/firefox/firefox_binary.py", line 163, in _get_firefox_start_cmd
    " Please specify the firefox binary location or install firefox")
RuntimeError: Could not find firefox in your system PATH. Please specify the firefox binary location or install firefox

【问题讨论】:

    标签: linux selenium firefox amazon-web-services path


    【解决方案1】:

    将以下内容添加到您的~/.profile

    export PATH="$PATH:/home/firefox"
    

    或者~/.bashrc,或者~/.bash_profile,如果shell是Bash。

    Shell initialization files

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-06-21
      • 1970-01-01
      • 2021-11-28
      • 2020-05-25
      • 2014-01-12
      • 2017-05-16
      相关资源
      最近更新 更多