from selenium import webdriver
browser = webdriver.Chrome()
When doing this; I am getting:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/pi/.local/lib/python3.9/site-packages/selenium/webdriver/chrome/webdriver.py", line 76, in __init__
RemoteWebDriver.__init__(
File "/home/pi/.local/lib/python3.9/site-packages/selenium/webdriver/remote/webdriver.py", line 157, in __init__
self.start_session(capabilities, browser_profile)
File "/home/pi/.local/lib/python3.9/site-packages/selenium/webdriver/remote/webdriver.py", line 252, in start_session
response = self.execute(Command.NEW_SESSION, parameters)
File "/home/pi/.local/lib/python3.9/site-packages/selenium/webdriver/remote/webdriver.py", line 321, in execute
self.error_handler.check_response(response)
File "/home/pi/.local/lib/python3.9/site-packages/selenium/webdriver/remote/errorhandler.py", line 242, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.WebDriverException: Message: unknown error: Chrome failed to start: crashed.
(unknown error: DevToolsActivePort file doesn't exist)
(The process started from chrome location /usr/bin/chromium-browser is no longer running, so ChromeDriver is assuming that Chrome has crashed.)
Therefore, I followed suggestions on several Sites, for example This one, to include some options as follows:
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
chrome_options = Options()
chrome_options.add_argument('--headless')
chrome_options.add_argument('--no-sandbox')
chrome_options.add_argument('--disable-dev-shm-usage')
browser = webdriver.Chrome(options=chrome_options)
very unpleasing, although, is that instead of getting an error or seeing the program successfully perform the webdriver's initialization, the program just stops giving me any output, and doesn't seem to timeout either (I waited like 10 mins while writing this question).
I am running Raspi OS 64-bit (Bullseye), and the system is freshly installed. Tested on both the most recent Selenium and on Selenium Version 3.141.0. The Version of Chromedriver is 98.0.4758.106, the same as Chromium-Browser.
How cant I get Selenium up and running? Best regards and looking forward to your suggestions! Reisbrot