I have been running Selenium, Chromedriver and Python on a Raspberry Pi 5. Because Chromedriver does not really have a version for ARM for download but there is a version on APT according
https://forums.raspberrypi.com/viewtopic.php?p=2155925#p2155925
So, I have been using this and it all works well when I am running via Geany
So, I have finished and now want to run this python script via CRON, so I put the details in but I am getting errors.
Traceback (most recent call last): File "/home/dean/main_venv/luxpowerdl.py", line 69, in <module>
driver = webdriver.Chrome(service=service)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/dean/main_venv/lib/python3.11/site-packages/selenium/webdriver/chrome/webdriver.py", line 45, in __init__
super().__init__( File "/home/dean/main_venv/lib/python3.11/site-packages/selenium/webdriver/chromium/webdriver.py", line 61, in __init__
super().__init__(command_executor=executor, options=options) File "/home/dean/main_venv/lib/python3.11/site-packages/selenium/webdriver/remote/webdriver.py", line 208, in __init__
self.start_session(capabilities) File "/home/dean/main_venv/lib/python3.11/site-packages/selenium/webdriver/remote/webdriver.py", line 292, in start_session
response = self.execute(Command.NEW_SESSION, caps)["value"]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/dean/main_venv/lib/python3.11/site-packages/selenium/webdriver/remote/webdriver.py", line 347, in execute
self.error_handler.check_response(response) File "/home/dean/main_venv/lib/python3.11/site-packages/selenium/webdriver/remote/errorhandler.py", line 229, in check_response
raise exception_class(message, screen, stacktrace) selenium.common.exceptions.SessionNotCreatedException: Message: session not created: Chrome failed to start: exited normally. (session not created: 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.) Stacktrace:
#0 0x5555f50dc3e4 <unknown>
#1 0x5555f4e11ac8 <unknown>
#2 0x5555f4e40fac <unknown>
#3 0x5555f4e3dc44 <unknown>
#4 0x5555f4e7cf08 <unknown>
#5 0x5555f4e48d74 <unknown>
#6 0x5555f4e49760 <unknown>
#7 0x5555f50a6a74 <unknown>
#8 0x5555f50a9e04 <unknown>
#9 0x5555f5096d7c <unknown>
#10 0x5555f50aa714 <unknown>
#11 0x5555f507f0e0 <unknown>
#12 0x5555f50cbbc4 <unknown>
#13 0x5555f50cbdc0 <unknown>
#14 0x5555f50db5b4 <unknown>
#15 0x7fff46fcee58 <unknown>
#16 0x7fff47037f9c <unknown>
The local where APT installs Chromedriver is usr/bin, it has Root as owner and permissions are good.
usr/bin is in my $PATH.
So, the python files runs fine from Geany, my user terminal, my user name is in the Root group, Chromedriver has root as owner with permissions for root as rwx, group as r-x and others as r-x and is also marked as an executable.
Any ideas how I can get cron (using crontab -e) to has access to chromedriver.
PS, Chromium browser is installed. All using Raspberry Pi 5 running Debian Bookworm.