I am completely unable to get Selenium (3.0.1) to work with Firefox (50.1.0) after the update. Here is the code that I am running with the associated errors:
from selenium import webdriver
website = 'www.google.com'
driver = webdriver.Firefox()
driver.get(website)
This gives the following errors:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python2.7/site-packages/selenium/webdriver/firefox/webdriver.py", line 135, in __init__
self.service.start()
File "/usr/local/lib/python2.7/site-packages/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.
I have read numerous posts talking about the need to add various executable files to my PATH variable in order to run Selenium, but I have thus far completely failed. My current PATH variable is the following:
$echo $PATH
/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
I have not been able to successfully append the firefox or geckodriver executable files. It appears to be there already (I've copied the executable to '/usr/local/bin', and it's still giving me the same error. Any and all help is greatly appreciated (Mac OS X user)
As usual, given a week of not working on this, then re-googling the problem, I was able to solve it. The hint that helped me was given in this link:
Selenium in Python on Mac - Geckodriver executable needs to be in PATH
I wasn't adding the geckodriver.exe file to the right path. When I downloaded and moved the file to my anaconda bin, it worked just fine:
mv geckodriver /anaconda/bin #after navigating to my downloads
Hope this helps!