Install or Updates the chromium-browser. To install the browser, you need to run the following command on your Raspberry Pi.
sudo apt-get install chromium-browser --yes
The Raspberry Pi 4 running 64bit architecture needs a special optimization version of chromium-browser due to its hardware. This will install the version of the web browser that is provided from the Raspberry Pi OS repository. This build of Chromium has special optimizations for the Raspberry Pi compiled into it. The Driver is rarely updated since it is not maintained by chromium project.
The Raspberry Pi 4 running 64bit architecture needs a special optimization version of ChromeDriver.
Get Chromedriver from Electron GitHub releases. Make sure it supports the installed chromium version on your Pie!
Make sure you downloaded the right os version.
Check the "Other Changes" or "Stack Upgrades" section on the Version Release Notes for
eg. Updated Chromium to 94.0.4606.61. part.
To get the needed versions for your chromium-browser installation
Enter: chromium-browser --product-version
And: chromedriver --product-version
NOTE: The 32bit RaspberryOS Image runs the armv7l architecture!
→ You need need the "chromedriver-VERSION-linux-armv7l.zip" version file.
sudo wget https://github.com/electron/electron/releases/download/v14.1.0/chromedriver-v14.1.0-linux-armv7l.zip
unzip chromedriver-v14.1.0-linux-armv7l.zip
after the download unzip the driver. Make sure to configure ChromeDriver on your system (move the chromedriver to /usr/lib)
sudo mv chromedriver /usr/bin/chromedriver
sudo chown root:root /usr/bin/chromedriver
sudo chmod +x /usr/bin/chromedriver
After configureing the driver reboot the Pi.
sudo reboot
After this everything should be set up.
ONLY In case you installed the wrong version of chromedriver.
removing chrome driver:
sudo rm -f /usr/bin/chromedriver
sudo rm -f /usr/local/bin/chromedriver
sudo rm -f /usr/local/share/chromedriver
Helpful sources:
Setup selenium with chromedriver
How to run selenium using python