0

I'm fairly new to Pi's and Python and trying to run selenium to try to do a web automated program on my PI Model B. I have everything installed and just trying to run a simple command like:

from selenium import webdriver

browser = webdriver.Firefox() browser.get('http://seleniumhq.org/')

This should open FireFox (as I've installed IceWeasel) but I keep getting this error:

Traceback (most recent call last): File "BingBotTest.py", line 3, in browser = webdriver.Firefox() File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/firefox/webdriver.py", line 142, in init self.service.start() File "/usr/local/lib/python2.7/dist-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 knew I needed the GeckoDriver for Firefox, so I downloaded it. I assumed I should download the ARM7 version of GeckoDriver. However when I extract it, it doesn't make an executable so I can route my code to it. Anyone with any guidance? Again I'm fairly new, so this could be a dumb question. Thanks. Any help is appreciated.

Ethan
  • 1
  • 1
  • 2

3 Answers3

1

I solved this problem by using PhantomJS. Install phantomjs package, then you can use:

browser = webdriver.PhantomJS()
Jacobm001
  • 11,904
  • 7
  • 47
  • 58
Walkance
  • 111
  • 3
1

It's depends on your pi version processor for using geckodriver, which Pi version are you using, currently geckodrive are only prebuild for ARM7 (pi3B) , if you would like to run it on Zero or older pi you need to download the geckodriver code and made your own build for the ARM versions you need!

0

Download geckodriver from below location and add it to your PATH veriable.

https://github.com/mozilla/geckodriver/releases

Exit existing command line and reopen the same. This should help you.

Liam Giannini
  • 659
  • 2
  • 10
  • 21