Python - Selenium in Ubuntu OSError: [Errno 20] Not a directory

python, selenium, ubuntu

Solution

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/

Problem

After installing Selenium in Ubuntu and adding geckodriver to path I get this error when I run ``` from selenium import webdriver driver = webdriver.Firefox() ``` error: ``` Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/firefox/webdriver.py", line 135, in __init__ self.service.start() File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/common/service.py", line 64, in start stdout=self.log_file, stderr=self.log_file) File "/usr/lib/python2.7/subprocess.py", line 710, in __init__ errread, errwrite) File "/usr/lib/python2.7/subprocess.py", line 1327, in _execute_child raise child_exception OSError: [Errno 20] Not a directory ``` What's going on? EDIT: Solved using chromedriver instead of geckodriver.

Original source