title: My flask selenium Firefox geckodriver not working in heroku
body: <p>I deployed flask app using selenium Firefox geckodriver in heroku use this method <a href="https://elements.heroku.com/buildpacks/pyronlaboratory/heroku-integrated-firefox-geckodriver" rel="nofollow noreferrer">heroku-integrated-firefox-geckodriver</a></p>
  <p>But I got this error</p>
  <pre><code>&gt; 2022-01-13T13:23:47.014999+00:00 app[web.1]: /app/insta/bot.py:37:
  &gt; DeprecationWarning: executable_path has been deprecated, please pass
  &gt; in a Service object
  &gt;     
  &gt;     2022-01-13T13:23:47.015013+00:00 app[web.1]:   self.bot = webdriver.Firefox(options=options,executable_path=os.environ.get(&quot;GECKODRIVER_PATH&quot;),
  &gt; firefox_binary=FirefoxBinary(os.environ.get(&quot;FIREFOX_BIN&quot;)))
  &gt;     
  &gt;     2022-01-13T13:23:47.015054+00:00 app[web.1]: /app/insta/bot.py:37: DeprecationWarning: firefox_binary has been deprecated, please pass in
  &gt; a Service object
  &gt;     
  &gt;     2022-01-13T13:23:47.015054+00:00 app[web.1]:   self.bot = webdriver.Firefox(options=options,executable_path=os.environ.get(&quot;GECKODRIVER_PATH&quot;),
  &gt; firefox_binary=FirefoxBinary(os.environ.get(&quot;FIREFOX_BIN&quot;)))
  &gt;     
  &gt;     2022-01-13T13:23:47.522706+00:00 heroku[router]: at=info method=POST path=&quot;/instalogin&quot; host=i-bot-1.herokuapp.com
  &gt; request_id=6329825e-962c-46c0-834e-d8966a927d29 fwd=&quot;42.106.180.246&quot;
  &gt; dyno=web.1 connect=0ms service=512ms status=500 bytes=2182
  &gt; protocol=https
  &gt;     
  &gt;     2022-01-13T13:23:47.520605+00:00 app[web.1]: [2022-01-13 13:23:47,519] ERROR in app: Exception on /instalogin [POST]
  &gt;     
  &gt;     2022-01-13T13:23:47.520615+00:00 app[web.1]: Traceback (most recent call last):
  &gt;     
  &gt;     2022-01-13T13:23:47.520616+00:00 app[web.1]:   File &quot;/app/.heroku/python/lib/python3.9/site-packages/flask/app.py&quot;, line
  &gt; 2073, in wsgi_app
  &gt;     
  &gt;     2022-01-13T13:23:47.520616+00:00 app[web.1]:     response = self.full_dispatch_request()
  &gt;     
  &gt;     2022-01-13T13:23:47.520617+00:00 app[web.1]:   File &quot;/app/.heroku/python/lib/python3.9/site-packages/flask/app.py&quot;, line
  &gt; 1518, in full_dispatch_request
  &gt;     
  &gt;     2022-01-13T13:23:47.520617+00:00 app[web.1]:     rv = self.handle_user_exception(e)
  &gt;     
  &gt;     2022-01-13T13:23:47.520618+00:00 app[web.1]:   File &quot;/app/.heroku/python/lib/python3.9/site-packages/flask/app.py&quot;, line
  &gt; 1516, in full_dispatch_request
  &gt;     
  &gt;     2022-01-13T13:23:47.520618+00:00 app[web.1]:     rv = self.dispatch_request()
  &gt;     
  &gt;     2022-01-13T13:23:47.520618+00:00 app[web.1]:   File &quot;/app/.heroku/python/lib/python3.9/site-packages/flask/app.py&quot;, line
  &gt; 1502, in dispatch_request
  &gt;     
  &gt;     2022-01-13T13:23:47.520619+00:00 app[web.1]:     return self.ensure_sync(self.view_functions[rule.endpoint])(**req.view_args)
  &gt;     
  &gt;     2022-01-13T13:23:47.520619+00:00 app[web.1]:   File &quot;/app/app.py&quot;, line 29, in wrap
  &gt;     
  &gt;     2022-01-13T13:23:47.520620+00:00 app[web.1]:     return f(*args, **kwargs)
  &gt;     
  &gt;     2022-01-13T13:23:47.520620+00:00 app[web.1]:   File &quot;/app/app.py&quot;, line 88, in instalogin
  &gt;     
  &gt;     2022-01-13T13:23:47.520620+00:00 app[web.1]:     bot = Bot(user)
  &gt;     
  &gt;     2022-01-13T13:23:47.520621+00:00 app[web.1]:   File &quot;/app/insta/bot.py&quot;, line 37, in __init__
  &gt;     
  &gt;     2022-01-13T13:23:47.520621+00:00 app[web.1]:     self.bot = webdriver.Firefox(options=options,executable_path=os.environ.get(&quot;GECKODRIVER_PATH&quot;),
  &gt; firefox_binary=FirefoxBinary(os.environ.get(&quot;FIREFOX_BIN&quot;)))
  &gt;     
  &gt;     2022-01-13T13:23:47.520622+00:00 app[web.1]:   File &quot;/app/.heroku/python/lib/python3.9/site-packages/selenium/webdriver/firefox/webdriver.py&quot;,
  &gt; line 174, in __init__
  &gt;     
  &gt;     2022-01-13T13:23:47.520622+00:00 app[web.1]:     self.service.start()
  &gt;     
  &gt;     2022-01-13T13:23:47.520623+00:00 app[web.1]:   File &quot;/app/.heroku/python/lib/python3.9/site-packages/selenium/webdriver/common/service.py&quot;,
  &gt; line 98, in start
  &gt;     
  &gt;     2022-01-13T13:23:47.520623+00:00 app[web.1]:     self.assert_process_still_running()
  &gt;     
  &gt;     2022-01-13T13:23:47.520625+00:00 app[web.1]:   File &quot;/app/.heroku/python/lib/python3.9/site-packages/selenium/webdriver/common/service.py&quot;,
  &gt; line 110, in assert_process_still_running
  &gt;     
  &gt;     2022-01-13T13:23:47.520626+00:00 app[web.1]:     raise WebDriverException(
  &gt;     
  &gt;     2022-01-13T13:23:47.520626+00:00 app[web.1]: selenium.common.exceptions.WebDriverException: Message: Service
  &gt; /app/vendor/geckodriver/geckodriver unexpectedly exited. Status code
  &gt; was: 64
  </code></pre>
  <p><a href="https://i.stack.imgur.com/Nqd2a.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Nqd2a.png" alt="enter image description here" /></a></p>
  <p>This is my code and this is my selenium code.
  This code perfectly working in my local computer.</p>
  <pre><code>        import os
          from selenium import webdriver
          from selenium.webdriver.firefox.options import Options
          from selenium.webdriver.firefox.firefox_binary import FirefoxBinary            
  
          options = Options()
          options.headless = True
          options.add_argument(&quot;-no-sandbox&quot;)
          user_agent = &quot;Mozilla/5.0 (iPhone; U; CPU iPhone OS 3_0 like Mac OS X; en-us) AppleWebKit/528.18 (KHTML, like Gecko) Version/4.0 Mobile/7A341 Safari/528.16&quot;
          options.set_preference(&quot;general.useragent.override&quot;, user_agent)
  
          bot = webdriver.Firefox(options=options,executable_path=os.environ.get(&quot;GECKODRIVER_PATH&quot;), firefox_binary=FirefoxBinary(os.environ.get(&quot;FIREFOX_BIN&quot;)))
          bot.set_window_size(500, 950)
  </code></pre>
  <p>I don't know why it's not working. I tried so many another methods but it's not working, please help.</p>