首页 > 解决方案 > Heroku 应用程序崩溃 /app/.apt/opt/google/chrome/chrome 不再运行

问题描述

我的 Heroku 应用程序在运行时不断崩溃我收到以下错误:

(The process started from chrome location /app/.apt/opt/google/chrome/chrome is no longer running, so ChromeDriver is assuming that Chrome has crashed.)

它是在 python 中使用 selenium 和 chromedriver 设置的。该应用程序使用无头浏览器在本地运行良好。但是,chromedriver 在 web 中运行时似乎无法打开 chrome。

我的 heroku 配置变量如下:

  1. CHROMEDRIVER_PATH = /app/.chromedriver/bin/chromedriver
  2. GOOGLE_CHROME_BIN = /app/.apt/opt/google/chrome/chrome
  3. GOOGLE_CHROME_SHIM = /app/.apt/usr/bin/google-chrome-stable

我的 Heroku 构建包如下:

  1. Heroku/蟒蛇
  2. https://github.com/heroku/heroku-buildpack-apt
  3. https://github.com/heroku/heroku-buildpack-chromedriver
  4. https://github.com/heroku/heroku-buildpack-google-chrome

标签: pythonseleniumherokuselenium-chromedriver

解决方案


推荐阅读