0

I've been trying to start selenium with Firefox with python but if I understand the Error message correctly it can't find the file. I've tried to find an answer to this, but every "answer" I find is on another operating system and doesn't have to do with my problem. I have Firefox installed and Selenium.

In the shell I enter:

from selenium import webdriver
browser = webdriver.Firefox()

and it returns:

Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/selenium/webdriver/common/service.py", line 76, in start stdin=PIPE) File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/subprocess.py", line 707, in init restore_signals, start_new_session) File "/Library/Frameworks/Python.framework/Versions/3.6/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 "", line 1, in browser = webdriver.Firefox() File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/selenium/webdriver/firefox/webdriver.py", line 152, in init self.service.start() File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/selenium/webdriver/common/service.py", line 83, in start os.path.basename(self.path), self.start_error_message) selenium.common.exceptions.WebDriverException: Message: 'geckodriver' executable needs to be in PATH.

Jules Dupont
  • 7,259
  • 7
  • 39
  • 39
Mr. Blue
  • 200
  • 2
  • 2
  • 13
  • Possible duplicate of https://stackoverflow.com/questions/40208051/selenium-using-python-geckodriver-executable-needs-to-be-in-path – PixelEinstein Mar 20 '18 at 21:08
  • 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) – PixelEinstein Mar 20 '18 at 21:10

0 Answers0