Python - Selenium in Ubuntu OSError: [Errno 20] Not a directory
Had the same problem. There were two ways to fix this for me:
Add executable_path arg in webdriver:
driver = webdriver.Firefox(executable_path='/path/to/geckodriver')
And the second way its to add folder that contains geckodriver using export (only folder, not geckodriver):
$ export PATH=$PATH:/path/to/
In addition to the answer by @Poloq, the simplest way would be keeping your geckodriver
binary in a directory which is already in your PATH
.
mv geckodriver /usr/local/bin
This way you can avoid additional settings/configurations in your project with the downside of having an additional step when deploying on different systems.