селен не может открыть URL с firefox - PullRequest
0 голосов
/ 19 марта 2020

Здравствуйте, я пытаюсь запустить небольшой код на python с селеном

options = Options()
options.binary = which("firefox")
options.headless = True
_logger.info('Start driver, {}'.format(which("firefox")))
driver = webdriver.Firefox(service_log_path='/opt/selenium/selenium.log', options=options)
_logger.info('Getting URL. {}'.format(url))
driver.get(url)

Я запускаю его в docker, и когда он пытается получить URL, я получаю эту ошибку:

  File "/usr/local/lib/python3.7/dist-packages/selenium/webdriver/remote/webdriver.py", line 333, in get
    self.execute(Command.GET, {'url': url})
  File "/usr/local/lib/python3.7/dist-packages/selenium/webdriver/remote/webdriver.py", line 321, in execute
    self.error_handler.check_response(response)
  File "/usr/local/lib/python3.7/dist-packages/selenium/webdriver/remote/errorhandler.py", line 242, in check_response
    raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.WebDriverException: Message: Failed to decode response from marionette

в журнале селена я вижу эту информацию

1584599749872   mozrunner::runner       INFO    Running command: "/usr/bin/firefox" "-marionette" "-headless" "-foreground" "-no-remote" "-profile" "/tmp/rust_mozprofileV7HwxB"
*** You are running in headless mode.
1584599750476   addons.webextension.screenshots@mozilla.org     WARN    Loading extension 'screenshots@mozilla.org': Reading manifest: Invalid extension permission: mozillaAddons
1584599750476   addons.webextension.screenshots@mozilla.org     WARN    Loading extension 'screenshots@mozilla.org': Reading manifest: Invalid extension permission: resource://pdf.js/
1584599750476   addons.webextension.screenshots@mozilla.org     WARN    Loading extension 'screenshots@mozilla.org': Reading manifest: Invalid extension permission: about:reader*
1584599752609   Marionette      INFO    Listening on port 40068
1584599752687   Marionette      WARN    TLS certificate errors will be ignored for this session
Exiting due to channel error.
[Child 3352, Chrome_ChildThread] WARNING: pipe error (3): Connection reset by peer: file /builds/worker/workspace/build/src/ipc/chromium/src/chrome/common/ipc_channel_posix.cc, line 357
Exiting due to channel error.
[GFX1-]: Receive IPC close with reason=AbnormalShutdown
[Child 3378, Chrome_ChildThread] WARNING: pipe error (50): Connection reset by peer: file /builds/worker/workspace/build/src/ipc/chromium/src/chrome/common/ipc_channel_posix.cc, line 357
[Child 3378, Chrome_ChildThread] WARNING: pipe error: Broken pipe: file /builds/worker/workspace/build/src/ipc/chromium/src/chrome/common/ipc_channel_posix.cc, line 726
Exiting due to channel error.

моя версия geckodriver - 0.26 python селен == 3.141.0 firefox - версия Mozilla Firefox 67.0.4

docker начинается с размера shm: 2gb

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...