Instapy: Unable to use QuickStart.py

Created on 14 Sep 2020  路  11Comments  路  Source: timgrossmann/InstaPy

This might be a dumb question, but I downloaded the folder, updated the quickstart to be the following:

`#!/usr/bin/python

-- coding: utf-8 --

imports

""" Quickstart script for InstaPy usage """

from instapy import InstaPy
from instapy import smart_run
from instapy import set_workspace

set workspace folder at desired location (default is at your home folder)

set_workspace(path=None)

get an InstaPy session!

session = InstaPy(username="", password="*")

with smart_run(session):

# general settings

session.set_dont_include(['friend1', 'friend2', 'friend3'])

# activity

session.like_by_tags(['wine', 'winery', 'goodwine'], amount=10)`

And I keep getting the following:

C:\Users\Jude\Desktop\InstaPy>python quickstart.py ._. ._. ._. ._. ._. ._. ._. ._. ._. ._. ._. No any custom workspace provided. ~using existing.. InstaPy Version: 0.6.10 ._. ._. ._. ._. ._. ._. ._. ._. ._. Workspace in use: "C:/Users/Jude/InstaPy" Traceback (most recent call last): File "quickstart.py", line 18, in <module> session = InstaPy(username='******', password='******') File "C:\Users\Jude\Desktop\InstaPy\instapy\instapy.py", line 323, in __init__ self.logger, File "C:\Users\Jude\Desktop\InstaPy\instapy\browser.py", line 124, in set_selenium_local_session options=firefox_options, File "C:\Users\Jude\AppData\Local\Programs\Python\Python37-32\lib\site-packages\selenium\webdriver\firefox\webdriver.py", line 174, in __init__ keep_alive=True) File "C:\Users\Jude\AppData\Local\Programs\Python\Python37-32\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 157, in __init__ self.start_session(capabilities, browser_profile) File "C:\Users\Jude\AppData\Local\Programs\Python\Python37-32\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 252, in start_session response = self.execute(Command.NEW_SESSION, parameters) File "C:\Users\Jude\AppData\Local\Programs\Python\Python37-32\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 321, in execute self.error_handler.check_response(response) File "C:\Users\Jude\AppData\Local\Programs\Python\Python37-32\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 242, in check_response raise exception_class(message, screen, stacktrace) selenium.common.exceptions.SessionNotCreatedException: Message: Unable to find a matching set of capabilities

I'm sure this is super stupid, but can someone please point me in the right direction as to why this is happening? I've made sure all of the requirements are installed, etc...

Also, I've blocked out the username and password for this example only, so that's not the issue. I'm also on a Windows machines.

Most helpful comment

Well, I'm not the right person to give advices for MacOS. I don't use it am not familiar with specifics.
But here are a two thoughts came to me reading your question:

  • browser_executable_path should point to your Firefox not geckodriver.
  • geckodriver_path should point to geckodriver.
    geckodriver_path ="/usr/local/bin/geckodriver",

All 11 comments

Hey, i had the same error. In my case a new install of geckodriver and Firefox fixed the problem

@goldenlindt - Tried this, unfortunately, it's not working for me. :/

Did you check if your version of geckodriver and Firefox are compatible?

Did you check if your version of geckodriver and Firefox are compatible?

geckodriver 0.27 support firefox 60+

I have

geckodriver 0.27.0 (7b8c4f32cdde 2020-07-28 18:16 +0000)
selenium 3.141.0
Mozilla Firefox 68.12.0esr

geckodriver setup in path. Idk what to do next... Which version do you have ?

I had the same problem. :-) yes I HAD it.
My context is CentOS Linux, Geckodriver 0.27.0, Firefox 68.12.0esr and Selenium 3.141.0.
When running InstaPy scripts I got nearly the same as @JudeMurphy quoted above.
Search in InstaPy Isseus section gave me no clue what is the problem. Search in Mozilla Geckodriver Issue section was more fruitful. I found this and get the idea to downgrade Geckodriver. I also found out that the other system where my scripts worked fine had Geckodriver ver 0.26.0. Therfore I downgraded Geckodriver from 0.27.0 to 0.26.0 on non-working system and my problem was past.
Hope it helps any of you too.

I had the same problem. :-) yes I HAD it.
My context is CentOS Linux, Geckodriver 0.27.0, Firefox 68.12.0esr and Selenium 3.141.0.
When running InstaPy scripts I got nearly the same as @JudeMurphy quoted above.
Search in InstaPy Isseus section gave me no clue what is the problem. Search in Mozilla Geckodriver Issue section was more fruitful. I found this and get the idea to downgrade Geckodriver. I also found out that the other system where my scripts worked fine had Geckodriver ver 0.26.0. Therfore I downgraded Geckodriver from 0.27.0 to 0.26.0 on non-working system and my problem was past.
Hope it helps any of you too.

Hey roberterzen,
I am new to Python and Instapy, yet I think the problem is similar to the one which you've have discussed.
my question is how do I downgrade it to 0.26.0 since I am running 0.27.0
Is there a pip install command?

Hi, @roberterzen! How can I install geckodriver 0.26.0?

It should be very easy but when I say "easy" it depends on your basic Linux knowledge.

  1. First you should check where do you have geckodriver now. When on linux prompt just type:
    which geckodriver
    I got: /usr/local/bin/geckodriver
  2. Then go to https://github.com/mozilla/geckodriver/releases and get exact link to 0.26.0 (https://github.com/mozilla/geckodriver/releases/download/v0.26.0/geckodriver-v0.26.0-linux64.tar.gz)
  3. Go Linux prompt
    cd ~
    wget https://github.com/mozilla/geckodriver/releases/download/v0.26.0/geckodriver-v0.26.0-linux64.tar.gz
  4. Unzip (untar) it:
    tar -xvzf geckodriver*
  5. Make it executable:
    chmod +x geckodriver
  6. Add the driver to directory where you had 0.27.0 version:
    mv geckodriver /usr/local/bin/geckodriver

That's it.

It should be very easy but when I say "easy" it depends on your basic Linux knowledge.

  1. First you should check where do you have geckodriver now. When on linux prompt just type:
    which geckodriver
    I got: /usr/local/bin/geckodriver
  2. Then go to https://github.com/mozilla/geckodriver/releases and get exact link to 0.26.0 (https://github.com/mozilla/geckodriver/releases/download/v0.26.0/geckodriver-v0.26.0-linux64.tar.gz)
  3. Go Linux prompt
    cd ~
    wget https://github.com/mozilla/geckodriver/releases/download/v0.26.0/geckodriver-v0.26.0-linux64.tar.gz
  4. Unzip (untar) it:
    tar -xvzf geckodriver*
  5. Make it executable:
    chmod +x geckodriver
  6. Add the driver to directory where you had 0.27.0 version:
    mv geckodriver /usr/local/bin/geckodriver

That's it.

I have done exactly that (I'm on a Mac) - when I type which geckodriver in my CLI it gives me: /usr/local/bin/geckodriver which means it is installed properly.
Then, when I run the quickstart.py file with basic testing parameters, I have the following error message if in create the session as:
session = InstaPy(username=insta_username,
password=insta_password,
headless_browser=False)
ERROR:
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.SessionNotCreatedException: Message: Unable to find a matching set of capabilities

If I do this:
session = InstaPy(username=insta_username,
password=insta_password,
headless_browser=False,
browser_executable_path='/usr/local/bin/geckodriver')
The error is then: raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.InvalidArgumentException: Message: binary is not a Firefox executable

I've been trying to figure it out for quite some time now, trying different approaches (putting geckodriver.exe in my InstaPy dir for instance), to no avail. Is there a solution to this? Thanks !

Well, I'm not the right person to give advices for MacOS. I don't use it am not familiar with specifics.
But here are a two thoughts came to me reading your question:

  • browser_executable_path should point to your Firefox not geckodriver.
  • geckodriver_path should point to geckodriver.
    geckodriver_path ="/usr/local/bin/geckodriver",

@roberterzen
Thanks! But I solved my problem just by installing Firefox on my Mac. Earlier I had only Firefox Developer's version.
And It works for me with geckodriver 0.27.0.
小锌邪褋懈斜芯 馃槈

Was this page helpful?
0 / 5 - 0 ratings