Problem
I have been playing around with a Python script using Selenium, which works fine locally (as I have ChromeDriver installed in the correct directory, which is assets/chromedriver), but it does not work on Heroku. A summary of the error message I get is this:
'chromedriver' executable needs to be in PATH.
No such file or directory: '/app/assets/chromedriver': '/app/assets/chromedriver'
ensure chromedriver is installed at /app/assets/chromedriver
Steps Taken
When deploying to Heroku, I have installed the following Buildpacks on my app:
- https://github.com/heroku/heroku-buildpack-python
- https://github.com/heroku/heroku-buildpack-chromedriver
- https://github.com/heroku/heroku-buildpack-google-chrome
(Note: a lot of the answers on StackOverflow talk about the heroku-xvfb-google-chrome buildpack instead, but I don't want to use that because it relies on Cedar-14, which is being deprecated in April this year.)
I've attempted to set $GOOGLE_CHROME_BIN and $GOOGLE_CHROME_SHIM as config variables pointing to the app/assets/chromedriver directory, but this hasn't worked. Does anyone have any idea of how to get chromedriver installed in a specific directory (in this case, app/assets/chromedriver) on Heroku?
I've been struggling with this for days now, and would really appreciate any help I can get!