Crontab:Selenium:Chrome无法启动:异常退出(未知错误:DevToolsActivePort文件不存在)

时间:2020-06-09 09:44:52

标签: python selenium raspberry-pi

我正在用硒和铬运行crontab。 我想在重新启动时显示屏幕,但这给了我这个错误。

(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.)

这是我的时间表:

 @reboot sleep 30 && DISPLAY=:0 sudo /usr/bin/python3 /home/pi/main.py > /home/pi/rasp.log 2>&1

我的python代码:

from selenium import webdriver

chrome_options = webdriver.ChromeOptions()
chrome_options.add_argument('--no-sandbox')

driver = webdriver.Chrome( executable_path="/usr/bin/chromedriver" ,
    service_args= [ "--verbose", "--log-path=/tmp/CHROMIUM_LOG" ],
    options = chrome_options
)

0 个答案:

没有答案