Somebody...Who use Selenium with Firefox. Write:
It's badly annoying! I have Firefox version 58.0.2, geckodriver 0.19.1, selenium 3.9.0, python 3.6.4 but it doesn't work ! Errors.
I installed Firefox without sudo apt-get (unzipped archive), cause repository haven't new version of Firefox.
So the problem is that selenium can't find Firefox because It's path isn't on your $PATH variable.
To solve the Issue, You've two options:
Install Firefox from a repository using the package manager
Specify the installed Firefox binary to selenium.
Add the Firefox binary to the Path variable.
For the second option:
To set the custom path to Firefox you need to use FirefoxBinary:
from selenium.webdriver.firefox.firefox_binary import FirefoxBinary
binary = FirefoxBinary('/Firefox/Path')
driver = webdriver.Firefox(firefox_binary=binary)
For the third option:
Add the following to your ~/.profile or ~/.bashrc:
export PATH="$PATH:/home/firefox"
Use
which firefox
or whereis firefox
to get Firefox path.