Selenium, Chromedriver и Python, работающие из CronPython

Программы на Python
Ответить Пред. темаСлед. тема
Гость
 Selenium, Chromedriver и Python, работающие из Cron

Сообщение Гость »


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/viewtopi ... 5#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 
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 
#1 0x5555f4e11ac8 
#2 0x5555f4e40fac 
#3 0x5555f4e3dc44 
#4 0x5555f4e7cf08 
#5 0x5555f4e48d74 
#6 0x5555f4e49760 
#7 0x5555f50a6a74 
#8 0x5555f50a9e04 
#9 0x5555f5096d7c 
#10 0x5555f50aa714 
#11 0x5555f507f0e0 
#12 0x5555f50cbbc4 
#13 0x5555f50cbdc0 
#14 0x5555f50db5b4 
#15 0x7fff46fcee58 
#16 0x7fff47037f9c 
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 (using

Код: Выделить всё

crontab -e
) to has access to

Код: Выделить всё

chromedriver
.
PS, Chromium browser is installed. All using Raspberry Pi 5 running Debian Bookworm.


Источник: https://stackoverflow.com/questions/781 ... -from-cron
Реклама
Ответить Пред. темаСлед. тема

Быстрый ответ

Изменение регистра текста: 
Смайлики
:) :( :oops: :roll: :wink: :muza: :clever: :sorry: :angel: :read: *x)
Ещё смайлики…
   
К этому ответу прикреплено по крайней мере одно вложение.

Если вы не хотите добавлять вложения, оставьте поля пустыми.

Максимально разрешённый размер вложения: 15 МБ.

  • Похожие темы
    Ответы
    Просмотры
    Последнее сообщение

Вернуться в «Python»