У меня есть VDS сервер с google-chrome=114.0.5735.90
При запуске моего python скрипта в первый раз после Reset OS, всё хорошо скрипт выполняется, хотя бывает что он сайта не открывает.
А вот при 2-ом разе уже 100% ошибка Cannot connect to chrome at localhost:ПОРТ
Полная ошибка:
Traceback (most recent call last):
File "/root/projects/ozon/main.py", line 59, in <module>
driver = uc.Chrome(driver_executable_path=str(service.path), options=options, service=service, headless=True, no_sandbox=True)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/projects/ozon/.venv/lib/python3.11/site-packages/undetected_chromedriver2/__init__.py", line 453, in __init__
super(Chrome, self).__init__(
File "/root/projects/ozon/.venv/lib/python3.11/site-packages/selenium/webdriver/chrome/webdriver.py", line 45, in __init__
super().__init__(
File "/root/projects/ozon/.venv/lib/python3.11/site-packages/selenium/webdriver/chromium/webdriver.py", line 56, in __init__
super().__init__(
File "/root/projects/ozon/.venv/lib/python3.11/site-packages/selenium/webdriver/remote/webdriver.py", line 206, in __init__
self.start_session(capabilities)
File "/root/projects/ozon/.venv/lib/python3.11/site-packages/undetected_chromedriver2/__init__.py", line 711, in start_session
super(selenium.webdriver.chrome.webdriver.WebDriver, self).start_session(
File "/root/projects/ozon/.venv/lib/python3.11/site-packages/selenium/webdriver/remote/webdriver.py", line 290, in start_session
response = self.execute(Command.NEW_SESSION, caps)["value"]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/projects/ozon/.venv/lib/python3.11/site-packages/selenium/webdriver/remote/webdriver.py", line 345, in execute
self.error_handler.check_response(response)
File "/root/projects/ozon/.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.WebDriverException: Message: unknown error: cannot connect to chrome at 127.0.0.1:58477
from chrome not reachable
Stacktrace:
#0 0x559a65b9f4e3 <unknown>
#1 0x559a658ceb00 <unknown>
#2 0x559a658bc436 <unknown>
#3 0x559a658fb9be <unknown>
#4 0x559a658f3884 <unknown>
#5 0x559a65932ccc <unknown>
#6 0x559a6593247f <unknown>
#7 0x559a65929de3 <unknown>
#8 0x559a658ff2dd <unknown>
#9 0x559a6590034e <unknown>
#10 0x559a65b5f3e4 <unknown>
#11 0x559a65b633d7 <unknown>
#12 0x559a65b6db20 <unknown>
#13 0x559a65b64023 <unknown>
#14 0x559a65b321aa <unknown>
#15 0x559a65b886b8 <unknown>
#16 0x559a65b88847 <unknown>
#17 0x559a65b98243 <unknown>
#18 0x7f089728f609 start_thread
Я уже пробовал Docker и разные параметры в python.
(Гуглил - нет ответа)