2

I've created a Python script to collect data from different websites using Selenium. On my Windows PC the script works fine and does exactly what it's supose to do. Now I'm trying to make my script run on my Raspberyy Pi. On my PC I use Google Chrome with selenium but ofcourse Chrome is not supported on a Raspberry Pi. Instead I have to use Chromium but I struggle to make this work. I use the following code to start my driver:

import requests
from selenium import webdriver

session_requests = requests.session()
ser = Service(r"/home/pi/Downloads/chromedriver")
op = webdriver.ChromeOptions()
driver = webdriver.Chrome(service=ser, options=op)

With this code I get the following error:

OSError: [Errno 8] Exec format error: '/home/pi/Downloads/chromedriver'

This error is because my chromedriver is for Google Chrome and not Chromium. When I look for the driver for Chromium, it automatically gives me the driver for Google Chrome instead.

I'm using Chromium version 98.0.4758.106. Is there a driver for Chromium or should I look for another solution? I found a work-around to download Google Chrome on my Raspberry Pi, but this does not look like it should be done. Any suggestions are appreciated, thanks in advance!

2
  • I found a work-around to download Google Chrome on my Raspberry Pi, but this does not look like it should be done. why do you think installing Google Chrome is not the right way? Commented May 9, 2022 at 13:48
  • @Daweo forums.raspberrypi.com/viewtopic.php?t=303452 I found this solution, but it already says that Google Chrome is CPU intensive and not made for raspberry pi Commented May 9, 2022 at 13:51

1 Answer 1

2

After a long search I found a solution for my own problem. People from the Raspbian project have compiled a chromium-chromedriver version for the armhf platform and added it to the repo. The following command line will add the Chromium-driver and make it ready to use:

sudo apt-get install chromium-chromedriver

With this solution you will no longer need to give the path to the driver.

Source: https://ivanderevianko.com/2020/01/selenium-chromedriver-for-raspberrypi

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.