1

I am trying to get selenium webdriver and hence chromedriver to run on a Raspberry Pi. So, I installed the latest package of chromium-browser and the latest chromedriver package from this source: https://launchpad.net/ubuntu/trusty/armhf/chromium-chromedriver/65.0.3325.181-0ubuntu0.14.04.1

The following very simple script crashes with the error code -4 (see full message below):

from selenium import webdriver
driver = webdriver.Chrome('/usr/lib/chromium-browser/chromedriver')
driver.get("http://www.google.com")

Here's the error:

Traceback (most recent call last):
  File "cookie-crawler.py", line 10, in <module>
    driver = webdriver.Chrome('/usr/lib/chromium-browser/chromedriver')
  File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/chrome/webdriver.py", line 73, in __init__
    self.service.start()
  File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/common/service.py", line 98, in start
    self.assert_process_still_running()
  File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/common/service.py", line 111, in assert_process_still_running
    % (self.path, return_code)
selenium.common.exceptions.WebDriverException: Message: Service /usr/lib/chromium-browser/chromedriver unexpectedly exited. Status code was: -4

As I could not find information about this status code, I would like to ask you, if you know what this means and where I can find further information to fix this. I already double-checked the versions of chromium-browser and chromedriver and this does not seem to be the problem. Thank you for any hints!

  • How in the universe can this be a duplicate of a **different issue** with **different error code**?! I found this non-duplicate thread when I searched for a solution for the actual problem but this _is not the answer_. Please double-check the details before marking questions as duplicate! – OxleyHammond Nov 20 '18 at 22:16

1 Answers1

0

for me it is because missing dependencies, check it

chromedriver --version
chromium-browser --version
# or
google-chrome --version
ewwink
  • 18,382
  • 2
  • 44
  • 54
  • Thanks for your help! Chromium browser is `Chromium 65.0.3325.181 Built on Raspbian , running on Raspbian 9.6` which seems fine. When running `/usr/lib/chromium-browser/chromedriver --version` the output is an error message, translated it says something like `invalid machine command` without any further info. I used `apt-get purge` to remove chromedriver and re-installed it, but this error comes up again. Maybe it was the wrong package? I used `chromium-chromedriver_65.0.3325.181-0ubuntu0.14.04.1_armhf.deb` – OxleyHammond Nov 17 '18 at 22:51
  • try run with parameter `-v` or `-V` and make sure `libc6, libgcc1, libglib2.0-0, libnspr4, libnss3, libx11-6 ` installed, if still error try old version – ewwink Nov 18 '18 at 01:07
  • Thank you, too! These libraries are all installed. Using other parameters also result in the error of 'invalid machine command'. I will try an older version without apt-get. – OxleyHammond Nov 18 '18 at 19:43
  • A short remark: I installed chromium-browser, chromedriver and selenium on another Pi Model (using 3B now) and it works straight forward. I do not know why it does not simply run on the Pi 3 (not B) which I used when creating this question. Mysteries of the universe. – OxleyHammond Nov 20 '18 at 22:18