4

I'm completely new to Python and everything related. I'm using this thing called Instapy and this is the error I get when I'm running the windows.start file.

Traceback (most recent call last):
  File "C:\Users\alexa\Downloads\instapy-quickstart-master\quickstart.py", line 14, in <module>
    session = InstaPy(username=insta_username,
  File "C:\Users\alexa\AppData\Local\Programs\Python\Python39\lib\site-packages\instapy\instapy.py", line 325, in __init__
    self.browser, err_msg = set_selenium_local_session(
  File "C:\Users\alexa\AppData\Local\Programs\Python\Python39\lib\site-packages\instapy\browser.py", line 123, in set_selenium_local_session
    browser = webdriver.Firefox(
  File "C:\Users\alexa\AppData\Local\Programs\Python\Python39\lib\site-packages\selenium\webdriver\firefox\webdriver.py", line 170, in __init__
    RemoteWebDriver.__init__(
  File "C:\Users\alexa\AppData\Local\Programs\Python\Python39\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 157, in __init__
    self.start_session(capabilities, browser_profile)
  File "C:\Users\alexa\AppData\Local\Programs\Python\Python39\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 252, in start_session
    response = self.execute(Command.NEW_SESSION, parameters)
  File "C:\Users\alexa\AppData\Local\Programs\Python\Python39\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 321, in execute
    self.error_handler.check_response(response)
  File "C:\Users\alexa\AppData\Local\Programs\Python\Python39\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 242, in check_response
    raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.SessionNotCreatedException: 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

I appreciate your help, stay safe and have a great day!

1 Answer 1

1

You can avoid this issue in two different ways:

  1. Explicit where to find firefox binary to your selenium code:
from selenium.webdriver.firefox.firefox_binary import FirefoxBinary
from selenium import webdriver
firefox_binary = FirefoxBinary('/usr/bin/firefox/')
driver = webdriver.Firefox(firefox_binary=firefox_binary)
  1. Add firefox to your PATH environment variable. (Windows, Ubuntu)
Sign up to request clarification or add additional context in comments.

1 Comment

Hey there, I can't edit the text that shows up, as soon as I press anything - it exits the application. Any advice? That's the error showing and I can't change anything at all. Thank you Mady!! I really appreciate your help by the way.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.