Прошу вашей помощи.
Я стартую скрипт и раза 4 он работает без ошибок, но потом появляется ошибка.
from selenium import webdriver
import esia_inf
import time
import esia_inform_insert
import send_email
from pyvirtualdisplay import Display
import traceback
import sent_to_telegram
try:
print('==================================================')
dt1 = time.strftime("%Y-%m-%d %H:%M:%S", time.localtime())
print('скрипт запущен в ' + dt1)
display = Display(visible=0, size=(800, 600))
display.start()
options = webdriver.ChromeOptions()
options.add_argument('--no-sandbox')
options.add_argument('--headless')
options.add_argument('--disable-dev-shm-usage')
driver = webdriver.Chrome('/usr/bin/google-chrome',chrome_options=options)
driver.get('https://test.ru/')
Логи ошибки:
Traceback (most recent call last):
File "./esia_informer.py", line 23, in <module>
driver = webdriver.Chrome(chrome_options=options)
File "/usr/local/lib/python3.6/dist-packages/selenium/webdriver/chrome/webdriver.py", line 81, in __init__
desired_capabilities=desired_capabilities)
File "/usr/local/lib/python3.6/dist-packages/selenium/webdriver/remote/webdriver.py", line 157, in __init__
self.start_session(capabilities, browser_profile)
File "/usr/local/lib/python3.6/dist-packages/selenium/webdriver/remote/webdriver.py", line 252, in start_session
response = self.execute(Command.NEW_SESSION, parameters)
File "/usr/local/lib/python3.6/dist-packages/selenium/webdriver/remote/webdriver.py", line 321, in execute
self.error_handler.check_response(response)
File "/usr/local/lib/python3.6/dist-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/google-chrome is no longer running, so ChromeDriver is assuming that Chrome has crashed.)
(Driver info: chromedriver=2.41.578700 (2f1ed5f9343c13f73144538f15c00b370eda6706),platform=Linux 4.15.0-88-generic x86_64)
как избавиться от ошибки?