Unable to run Selenium with a webdriver

733 views
Skip to first unread message

Dean Harry Smith

unread,
Mar 6, 2024, 4:01:42 AMMar 6
to Selenium Users
Hello,
I am trying to install Selenium along with a webdriver on my Raspberry 5 running Debian Bookworm

I am running python in a virtual environment.
I run pip install selenium to install Selenium, according to the docs it should also download a webdriver
I am trying to run a simple python file but I keep coming up with the same error that it can not find the webdriver.

I have now downloaded and installed chromedriver and also geckodriver and placed them in various location that are in my path but still keep getting the same error message (see below), my $PATH is
(main_venv) sean@server:~ $ echo $PATH
/home/sean/main_venv:/home/sean/main_venv/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/games:/usr/games

I have chromedriver and also geckodriver in /home/sean/main_venv:/home/sean/main_venv/bin:/usr/local/bin and the files are marked as executable

Traceback (most recent call last):
  File "/home/sean/main_venv/lib/python3.11/site-packages/selenium/webdriver/common/driver_finder.py", line 38, in get_path
    path = SeleniumManager().driver_location(options) if path is None else path
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/sean/main_venv/lib/python3.11/site-packages/selenium/webdriver/common/selenium_manager.py", line 89, in driver_location
    args = [str(self.get_binary()), "--browser", browser]
                ^^^^^^^^^^^^^^^^^
  File "/home/sean/main_venv/lib/python3.11/site-packages/selenium/webdriver/common/selenium_manager.py", line 63, in get_binary
    raise WebDriverException(f"Unsupported platform/architecture combination: {sys.platform}/{arch}")
selenium.common.exceptions.WebDriverException: Message: Unsupported platform/architecture combination: linux/aarch64


The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/sean/main_venv/tt.py", line 4, in <module>
    driver = webdriver.Chrome()
             ^^^^^^^^^^^^^^^^^^
  File "/home/sean/main_venv/lib/python3.11/site-packages/selenium/webdriver/chrome/webdriver.py", line 45, in __init__
    super().__init__(
  File "/home/sean/main_venv/lib/python3.11/site-packages/selenium/webdriver/chromium/webdriver.py", line 49, in __init__
    self.service.path = DriverFinder.get_path(self.service, options)
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/sean/main_venv/lib/python3.11/site-packages/selenium/webdriver/common/driver_finder.py", line 41, in get_path
    raise NoSuchDriverException(msg) from err
selenium.common.exceptions.NoSuchDriverException: Message: Unable to obtain driver for chrome using Selenium Manager.; For documentation on this error, please visit: https://www.selenium.dev/documentation/webdriver/troubleshooting/errors/driver_location


Any help would be great

Dean Harry Smith

unread,
Mar 7, 2024, 3:31:35 AMMar 7
to Selenium Users
Finally found out that it won't work on a Raspberry Pi because it's ARM based and their is not really anything availble however there is a way to install ChromeDriver via apt

sudo apt install chromium-chromedriver

This now works with a simple Selenium python script
#https://forums.raspberrypi.com/viewtopic.php?p=2155925#p2155925
# use sudo apt install chromium-chromedriver
from selenium import webdriver
from selenium.webdriver.chrome.service import Service
service = Service('/usr/bin/chromedriver')

driver = webdriver.Chrome(service=service)
driver.get('https://forums.raspberrypi.com')
print(driver.title)
driver.quit()



Hope this helps anyone else looking to use ChromeDriver on a Raspberry Pi using Debian Bookworm
Reply all
Reply to author
Forward
0 new messages