Запуск Selenium на AWS Ubuntu — Ошибка: не удалось найти firefox в вашей системе PATH

Я использую python 2.7.12 с selenium версии 2.53.6 и firefox 46.0.1 на экземпляре AWS Ubuntu Server 16.04 LTS. Я установил pyvirtualdisplay.

Когда я запускаю этот код:

from pyvirtualdisplay import Display
from selenium import webdriver

display = Display(visible=0, size=(1024, 768))
display.start()
driver = webdriver.Firefox()

Я получаю эту ошибку:

Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/ubuntu/anaconda2/lib/python2.7/site- packages/selenium/webdriver/firefox/webdriver.py", line 55, in __init__
self.binary = firefox_binary or capabilities.get("binary", FirefoxBinary())
File "/home/ubuntu/anaconda2/lib/python2.7/site-packages/selenium/webdriver/firefox/firefox_binary.py", line 47, in __init__
self._start_cmd = self._get_firefox_start_cmd()
File "/home/ubuntu/anaconda2/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

Я пытался добавить ссылку в свой профиль bash

echo export 'PATH="$PATH:/home/firefox"' >> ~/.bashrc

Но не увенчались успехом. Любая помощь будет принята с благодарностью.


person gtownrower    schedule 25.06.2017    source источник
comment
Вы установили Firefox в систему (приложение, а не драйвер)   -  person whackamadoodle3000    schedule 25.06.2017
comment
Да, я установил его отсюда ftp.mozilla.org/pub/firefox/releases/46.0.1/linux-x86_64/en-US   -  person gtownrower    schedule 25.06.2017
comment
stackoverflow.com/questions/27202131/   -  person whackamadoodle3000    schedule 25.06.2017
comment
Попробуйте установить следующим образом: stackoverflow.com/questions/33151809/   -  person whackamadoodle3000    schedule 25.06.2017
comment
У меня уже установлен xvfb   -  person gtownrower    schedule 25.06.2017