Quote:I have changed the permission from the / with rmx to all users, directories and files, in case, "geckodriver". Also, I have inserted "geckodriver" and its PATH on the enviromnent PATH, and, also, to the "Interpreter Paths".You should not need to do any of that. The only odd thing might be PyCharm specific.
just copy geckodriver to your /usr/local/bin
example:
metulburr@ubuntu:~$ cat test11.py from selenium import webdriver nav = webdriver.Firefox()
metulburr@ubuntu:~$ python3 test11.py Traceback (most recent call last): File "/usr/local/lib/python3.6/site-packages/selenium/webdriver/common/service.py", line 74, in start stdout=self.log_file, stderr=self.log_file) File "/usr/local/lib/python3.6/subprocess.py", line 707, in __init__ restore_signals, start_new_session) File "/usr/local/lib/python3.6/subprocess.py", line 1326, in _execute_child raise child_exception_type(errno_num, err_msg) FileNotFoundError: [Errno 2] No such file or directory: 'geckodriver' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "test11.py", line 2, in <module> nav = webdriver.Firefox() File "/usr/local/lib/python3.6/site-packages/selenium/webdriver/firefox/webdriver.py", line 144, in __init__ self.service.start() File "/usr/local/lib/python3.6/site-packages/selenium/webdriver/common/service.py", line 81, in start os.path.basename(self.path), self.start_error_message) selenium.common.exceptions.WebDriverException: Message: 'geckodriver' executable needs to be in PATH.
metulburr@ubuntu:~$ mv /home/geckodriver /usr/local/bin mv: cannot move '/home/geckodriver' to '/usr/local/bin/geckodriver': Permission denied metulburr@ubuntu:~$ sudo !! sudo mv /home/geckodriver /usr/local/bin [sudo] password for metulburr:
metulburr@ubuntu:~$ python3 test11.py metulburr@ubuntu:~$you could also just set the path directly
driver = webdriver.Firefox(executable_path='your\path\geckodriver')
Recommended Tutorials: