I am running an ubuntu 22.04 ARM64 UTM virtual machine on an Apple M1 mini. I am trying to get chromedriver running via python on this ARM64 architecture using this code snippet:
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
def myFunc(URL):
webDriver = None
try:
chrome_driver_path = '/usr/bin/chromedriver'
chromeOptions = Options()
chromeOptions.add_argument("--headless=new")
chromeOptions.add_argument("--start-maximized")
chromeOptions.binary_location = chrome_driver_path
webDriver = webdriver.Chrome(options=chromeOptions) <----- This line fails
webDriver.get(URL)
Do something....
except Exception as e:
print(e)
if webDriver != None:
webDriver.close()
webDriver = None
return webDriver
I installed chromium and chromedriver using: sudo apt-get install chromium-chromedriver
and the versions of chromium and chromedriver are: Chromium 122.0.6261.94 snap ChromeDriver 122.0.6261.94 (880dbf29479c6152d5e4f08dfd3a96b30f919e56-refs/branch-heads/6261@{#960})
- I have verified I can run the chromedriver at /usr/bin/chromedriver
- I have tried not supplying the binary path to the chromedriver
The code throws an exception at the indicate line: '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