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.
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.
The problem is that you renamed "geckodriver" to "wires".
The solution is to add "geckodriver" to search path then it should work.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With