CarlyCory
Posts: 1
Joined: Fri Aug 17, 2018 12:48 am

Getting selenium to work on my raspberry pi 3

Fri Aug 17, 2018 12:57 am

I've been following Jaymz's guide from:https://www.raspberrypi.org/forums/view ... 2#p1246095


In which he said

Code: Select all

$ sudo apt-get upgrade
$ sudo apt-get update
$ sudo apt-get install iceweasel
$ sudo pip3 install selenium
$ curl -O https://github.com/mozilla/geckodriver/ ... 7hf.tar.gz
$ tar -xzvf geckodriver-v0.19.1-arm7hf.tar.gz
$ sudo cp geckodriver /usr/local/bin/
$ python3
>>> from selenium import webdriver
>>> browser = webdriver.Firefox()
and a browser pops up

And a browser did pop up, but so did an error.

Code: Select all

[email protected]:~ $ python3 
Python 3.5.3 (default, Jan 19 2017, 14:11:04) 
[GCC 6.3.0 20170124] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from selenium import webdriver
brow>>> browser=webdriver.Firefox()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.5/dist-packages/selenium/webdriver/firefox/webdriver.py", line 167, in __init__
    keep_alive=True)
  File "/usr/local/lib/python3.5/dist-packages/selenium/webdriver/remote/webdriver.py", line 156, in __init__
    self.start_session(capabilities, browser_profile)
  File "/usr/local/lib/python3.5/dist-packages/selenium/webdriver/remote/webdriver.py", line 251, in start_session
    response = self.execute(Command.NEW_SESSION, parameters)
  File "/usr/local/lib/python3.5/dist-packages/selenium/webdriver/remote/webdriver.py", line 320, in execute
    self.error_handler.check_response(response)
  File "/usr/local/lib/python3.5/dist-packages/selenium/webdriver/remote/errorhandler.py", line 242, in check_response
    raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.WebDriverException: Message: connection refused

Googling, this it seems to indicate this to be a pretty standard error experienced even by those on standard computers. a lot of people said that updating firefox fixes this error but that can't be the case for me because i only just set up latest raspbian today and followed jaymz's instructions so my iceweasel must be the newest.

I completely followed jaymz's instructions after setting up my raspberry pi3. without having done anything else. In case it's important, i have it attached with a monitor with hdmi.

matteotinkerino
Posts: 1
Joined: Sun Sep 02, 2018 12:23 pm

Re: Getting selenium to work on my raspberry pi 3

Tue Sep 04, 2018 10:12 pm

Hi, having the same issues. Did you solve this?

User avatar
scruss
Posts: 1832
Joined: Sat Jun 09, 2012 12:25 pm
Location: Toronto, ON
Contact: Website

Re: Getting selenium to work on my raspberry pi 3

Wed Sep 05, 2018 12:41 am

Iceweasel's based on Firefox 52, and geckodriver v0.19 needs Firefox 55+, so they won't work together.

See if you can find a binary of current Firefox >= 57 that will work with the current geckodriver 0.21
‘Remember the Golden Rule of Selling: “Do not resort to violence.”’ — McGlashan.

fruitoftheloom
Posts: 17678
Joined: Tue Mar 25, 2014 12:40 pm

Re: Getting selenium to work on my raspberry pi 3

Wed Sep 05, 2018 9:24 am

scruss wrote:
Wed Sep 05, 2018 12:41 am
Iceweasel's based on Firefox 52, and geckodriver v0.19 needs Firefox 55+, so they won't work together.

See if you can find a binary of current Firefox >= 57 that will work with the current geckodriver 0.21

https://www.raspberrypi.org/forums/view ... 3&t=150438
Adieu

User avatar
scruss
Posts: 1832
Joined: Sat Jun 09, 2012 12:25 pm
Location: Toronto, ON
Contact: Website

Re: Getting selenium to work on my raspberry pi 3

Wed Sep 05, 2018 1:06 pm

to use this you will have to switch to a 64-bit kernel

I think that would be a hard pass for most people.Also, the instructions pre-date Firefox 57, so you're going to get an old lumpy browser. 57 was a complete rewrite. While it's more memory efficient, it doesn't look as if it runs well (or at all) on 32-bit armhf
‘Remember the Golden Rule of Selling: “Do not resort to violence.”’ — McGlashan.

fruitoftheloom
Posts: 17678
Joined: Tue Mar 25, 2014 12:40 pm

Re: Getting selenium to work on my raspberry pi 3

Wed Sep 05, 2018 1:11 pm

scruss wrote:
Wed Sep 05, 2018 1:06 pm
to use this you will have to switch to a 64-bit kernel

I think that would be a hard pass for most people.Also, the instructions pre-date Firefox 57, so you're going to get an old lumpy browser. 57 was a complete rewrite. While it's more memory efficient, it doesn't look as if it runs well (or at all) on 32-bit armhf

Will have to wait until firefox-esr 60.x is available, though it is now in Sid:

https://packages.debian.org/sid/firefox-esr
Adieu

Return to “Python”