heroku/heroku-buildpack-chromedriver

No such file or directory: 'chromedriver'

jdrengifoc opened this issue · 3 comments

I'm new in hekoru and I'm trying to develop a web scraper that works on hekoru constantly. The code is working in my local machine, but I don't have clarity of how initiallize the driver in Hekoru. I had alredy done:

  1. Install chrome heroku buildpacks:publish heroku/google-chrome master
  2. Install the chromedriver heroku create --buildpack https://github.com/rking32/heroku-buildpack-chromedriver.git
  3. Deploy manually my app from the branch of my GitHub repo.
    • In my app setting appears the the driver and chrome are were are suposed to be:

image

  1. Try to init my driver in python with selenium as follows
from selenium import webdriver
chrome_options = webdriver.ChromeOptions()
driver = webdriver.Chrome(chrome_options=chrome_options)

Sadly, This code returns the next error

/app/Heroku/betpages_heroku.py:40: DeprecationWarning: use options instead of chrome_options
  driver = webdriver.Chrome(chrome_options=chrome_options)
Traceback (most recent call last):
  File "/app/.heroku/python/lib/python3.9/site-packages/selenium/webdriver/common/service.py", line 71, in start
    self.process = subprocess.Popen(cmd, env=self.env,
  File "/app/.heroku/python/lib/python3.9/subprocess.py", line 951, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/app/.heroku/python/lib/python3.9/subprocess.py", line 1821, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'chromedriver'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/app/Heroku/betpages_heroku.py", line 168, in <module>
    betplay(url)
  File "/app/Heroku/betpages_heroku.py", line 40, in betplay
    driver = webdriver.Chrome(chrome_options=chrome_options)
  File "/app/.heroku/python/lib/python3.9/site-packages/selenium/webdriver/chrome/webdriver.py", line 70, in __init__
    super(WebDriver, self).__init__(DesiredCapabilities.CHROME['browserName'], "goog",
  File "/app/.heroku/python/lib/python3.9/site-packages/selenium/webdriver/chromium/webdriver.py", line 90, in __init__
    self.service.start()
  File "/app/.heroku/python/lib/python3.9/site-packages/selenium/webdriver/common/service.py", line 81, in start
    raise WebDriverException(
selenium.common.exceptions.WebDriverException: Message: 'chromedriver' executable needs to be in PATH. Please see https://chromedriver.chromium.org/home

running into the same problem here.
I'm using spring-boot app

Can you actively check if the chromedriver exists in that path e.g. by jumping into the Heroku CLI and finding the binary exe for chromedriver?

Closing stale issues. If the issue persists with the latest version of the buildpack please open a new issue with a minimal reproducable example (but also bear in mind that this buildpack is not an officially supported buildpack, so unless there is an actual bug with the buildpack, application debugging issues are generally out of scope).