0

Tried to deploy a survey bot for instagram using InstaPY but after adding https://github.com/evosystem-jp/heroku-buildpack-firefox buildpack to Heroku and setting GECKODRIVER_PATH to /app/vendor/geckodriver and FIREFOX_BIN to /app/vendor/firefox it throws an error. enter image description here

Here's my code:

from instapy import InstaPy
from selenium import webdriver

import os
#Login 
session = InstaPy(username="USERNAME", password="PASSWORD",
                                geckodriver_path = os.environ.get("GECKODRIVER_PATH"), browser_executable_path=os.environ.get("FIREFOX_BIN"),
                                headless_browser = True)
    
session.login()
Sumit Jaiswal
  • 216
  • 1
  • 4
  • 17
  • 1
    You probably should use /app/vendor/geckodriver/ instead of /app/vendor/geckodriver/geckodriver – Fominykh Maxim Nov 19 '20 at 15:28
  • @Fominykh Maxim Now its asking for browser binary location. How should I add it? – Sumit Jaiswal Nov 19 '20 at 15:34
  • instead of geckodriver_path try using browser_executable_path=/app/vendor/geckodriver/geckodriver – Fominykh Maxim Nov 19 '20 at 15:37
  • @Fominykh Maxim That brought back the same problem. `Message: Expected browser binary location, but unable to find binary in default location, no 'moz:firefoxOptions.binary' capability provided, and no binary flag set on the command line` was the exact error last time with `/app/vendor/geckodriver`. – Sumit Jaiswal Nov 19 '20 at 15:51

1 Answers1

0

Inside the InstaPy class parameters, you should explicitly add browser_executable_path.

Try the following:

session = InstaPy(username="USERNAME",
                  password="PASSWORD",
                  browser_executable_path=os.environ.get("GECKODRIVER_PATH"),
                  headless_browser=True)