微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

如何在Amazon Web Service的Linux实例上的系统PATH中添加firefox?

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

>>> 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

解决方法:

将以下内容添加到您的〜/ .profile中:

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

如果外壳是Bash,则转至〜/ .bashrc,或转至〜/ .bash_profile.

查看Shell initialization files

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。

相关推荐