-1

so, i wanted to work with selenium with python but everytime i get an error.

    Traceback (most recent call last):
  File "/home/lario/.local/lib/python3.5/site-packages/selenium/webdriver/common/service.py", line 74, in start
    stdout=self.log_file, stderr=self.log_file)
  File "/usr/lib/python3.5/subprocess.py", line 676, in __init__
    restore_signals, start_new_session)
  File "/usr/lib/python3.5/subprocess.py", line 1282, 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 "a.py", line 7, in <module>
    browser = webdriver.Firefox(firefox_binary=binary)
  File "/home/lario/.local/lib/python3.5/site-packages/selenium/webdriver/firefox/webdriver.py", line 144, in __init__
    self.service.start()
  File "/home/lario/.local/lib/python3.5/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. 

i have tried to run this code

export PATH=$PATH:/home/lario/Desktop/workstation/geckodriver

but it just keeps saying this. Is there a way to put this in all directories? And how do i fix the first error?

  • 1
    Possible duplicate of [Selenium using Python - Geckodriver executable needs to be in PATH](https://stackoverflow.com/questions/40208051/selenium-using-python-geckodriver-executable-needs-to-be-in-path) – Andersson Oct 07 '17 at 20:14
  • these answers still dont work, i cant copy and past my geckodriver –  Oct 07 '17 at 20:30

1 Answers1

1

Your issue is that you are adding geckodriver to path and not the folder containing geckodriver to the path. Use below

export PATH=$PATH:/home/lario/Desktop/workstation/
Tarun Lalwani
  • 142,312
  • 9
  • 204
  • 265
  • 1
    Thnx but i already fixed it, i needed to put geckodriver in /usr/bin/ –  Oct 08 '17 at 15:25