Home >Backend Development >Python Tutorial >Why Does My Selenium WebDriver Get a \'Session Deleted Because of Page Crash\' Error?

Why Does My Selenium WebDriver Get a \'Session Deleted Because of Page Crash\' Error?

Mary-Kate Olsen
Mary-Kate OlsenOriginal
2024-12-27 12:34:12141browse

Why Does My Selenium WebDriver Get a

WebDriver Exception: Unknown Error: Session Deleted Because of Page Crash

Selenium users may encounter a confusing error message while using ChromeDriver:

unknown error: session deleted because of page crash
from unknown error: cannot determine loading status
from tab crashed

This error results from a crash in the Chromium web engine underlying the Chrome browser, typically triggered by limited resources or specific system settings.

Solution:

To resolve this issue, several solutions are available:

  • Add Chrome Options:

    • chrome_options.add_argument('--no-sandbox')
  • Increase /dev/shm Size:

    • sudo mount -t tmpfs -o rw,nosuid,nodev,noexec,relatime,size=512M tmpfs /dev/shm
  • Share /dev/shm via Docker:

    • -v /dev/shm:/dev/shm
  • Disable Dev Shm Usage:

    • chrome_options.add_argument('--disable-dev-shm-usage')

Additional Note:

The error message "from tab crashed" is related to a Chrome issue in which the system attempts to use /dev/shm for non-executable memory. The underlying fix is included in Chrome v65.0.3299.6.

The above is the detailed content of Why Does My Selenium WebDriver Get a 'Session Deleted Because of Page Crash' Error?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn