3

I'm trying to utilize python selenium with firefox in accordance with the documentation, but I get the below error

See below for my script

from selenium import webdriver

driver = webdriver.Firefox()
driver.get("https://www.google.com/")

See below for my error

Traceback (most recent call last):
  File "/Users/Chris/Desktop/firefox_try.py", line 3, in <module>
    driver = webdriver.Firefox()
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/selenium-3.0.1-py2.7.egg/selenium/webdriver/firefox/webdriver.py", line 135, in __init__
    self.service.start()
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/selenium-3.0.1-py2.7.egg/selenium/webdriver/common/service.py", line 71, in start
    os.path.basename(self.path), self.start_error_message)
selenium.common.exceptions.WebDriverException: Message: 'geckodriver' executable needs to be in PATH. 

Exception AttributeError: "'Service' object has no attribute 'process'" in <bound method Service.__del__ of <selenium.webdriver.firefox.service.Service object at 0x1006890d0>> ignored

I've tried re-installing selenium's python bindings, which I did by just installing from this link with little luck: https://pypi.python.org/pypi/selenium#downloads

Chris
  • 5,444
  • 16
  • 63
  • 119
  • 2
    `'geckodriver' executable needs to be in PATH.` have you tried to fix that? maybe this will help: http://stackoverflow.com/questions/40208051/selenium-using-python-geckodriver-executable-needs-to-be-in-path – Urban48 Oct 25 '16 at 14:47

1 Answers1

1

Looks like the 'geckodriver' executable needs to be in your PATH.

Here's a site explaining how to set up the webdriver: https://developer.mozilla.org/en-US/docs/Mozilla/QA/Marionette/WebDriver

The command that they specify to add geckodriver to path is:

export PATH=$PATH:/path/to/geckodriver

I'd suggest you put it in ~/.local/bin

R. Rustad
  • 11
  • 2