Encountered this error while using Selenium with ChromeDriver on Heroku Free dyno.

Error Message

selenium.common.exceptions.WebDriverException: Message: unknown error: session deleted because of page crash
from unknown error: cannot determine loading status
from tab crashed

TL;DR

Added these two arguments for Selenium ChromeOptions solved my problem.

chrome_options.add_argument('--no-sandbox')
chrome_options.add_argument('--disable-dev-shm-usage')

Detail

  • --disable-dev-shm-usage
    • This will force Chrome to use the /tmp directory instead. This may slow down the execution though since disk will be used instead of memory.

  • "from tab crashed"
    • Relates to Linux attempting to always use /dev/shm for non-executable memory.


References


Share


Donation

如果覺得這篇文章對你有幫助, 除了留言讓我知道外, 或許也可以考慮請我喝杯咖啡, 不論金額多寡我都會非常感激且能鼓勵我繼續寫出對你有幫助的文章。

If this blog post happens to be helpful to you, besides of leaving a reply, you may consider buy me a cup of coffee to support me. It would help me write more articles helpful to you in the future and I would really appreciate it.


Related Posts