0

I've been trying to run selenium webdriver on raspberry OS.

Basically what I did:

pip3 install selenium
sudo apk-get install chromium-chromedriver

And run this script:

from selenium import webdriver

driver = webdriver.Chrome('/usr/bin/chromedriver')
driver.get('https://google.com')

With these variations:

driver = webdriver.Chrome(service=Service('/usr/bin/chromedriver'))
driver = webdriver.Chrome(service=Service('/usr/lib/chromium-browser/chromedriver'))

Also tried setting binary location:

options.BinaryLocation = "/usr/bin/chromium-browser/chromium-browser"

All of it boils down to an error which is:

Message: Service /usr/bin/chromedriver unexpectedly exited. Status code was: -4

I've tried reinstalling selenium, reinstalling chromium, updating everything. It always fails with status code -4 which is not very informative and hard to debug.

It seems like I'm getting illegal operation message whenever I try to get chromedriver/chromium --version which might be the clue why something is off.

1
  • "Ilegal opertation" implies the executable was compiled for the wrong ISA
    – goldilocks
    May 28, 2023 at 21:25

1 Answer 1

0

I have had the same problem and tried most of the stuff that people write on the internet regarding selenium and ARMv6Z.

What finally worked for the website I tried to scrape was:

https://stackoverflow.com/questions/45659532/scrapy-and-javascript-sites-on-rasbperry-pi

So basically set url=XHR requests and then use:

import urllib.request, json 

with urllib.request.urlopen(url) as url:

data = json.load(url)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.