Instapy: Unable to run any application when headless_browser is set to True

Created on 5 May 2019  路  12Comments  路  Source: timgrossmann/InstaPy



I understand that this issue might be a bit vague, however, I'm quite unsure on how to fix these errors.

To give some context, I've been running InstaPy on four accounts over the last month that are configured to run with their own IP address each and are not running at a particularly high rate. I can access all of the accounts just fine from both my phone and web browsers (Chrome). I'm getting different errors on the accounts.

Expected Behavior

Application to run as expected and perform a normal like, follow and unfollow pattern.

Current Behavior

One account gives me the following:

._.  ._.  ._.  ._.  ._.  ._.  ._.  ._.  ._.  ._.  ._.  ._.  ._.  ._.  ._.  ._.  ._.  ._.  ._.  ._.  ._.  ._. 

OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO
oooooooooooooooooooooooooooooooooooooooooooooooooooooo

INFO [2019-05-05 13:43:40] [redacted]  Session started!

......................................................................
INFO [2019-05-05 13:44:12] [redacted]  Logged in successfully!
INFO [2019-05-05 13:44:12] [redacted]  Saving account progress...
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
INFO [2019-05-05 13:44:15] [redacted]  Tag [1/19]
INFO [2019-05-05 13:44:15] [redacted]  --> b'redacted'
INFO [2019-05-05 13:44:24] [redacted]  desired amount: 100  |  top posts [disabled]: 9  |  possible posts: 203045
INFO [2019-05-05 13:45:03] [redacted]  Like# [1/100]
INFO [2019-05-05 13:45:03] [redacted]  https://www.instagram.com/p/redacted
INFO [2019-05-05 13:45:05] [redacted]  Image from: b'[redacted]'
INFO [2019-05-05 13:45:05] [redacted]  Link: b'redacted'
INFO [2019-05-05 13:45:05] [redacted]  Description: b'redacted'
INFO [2019-05-05 13:45:09] [redacted]  User: 'redacted'  |> followers: 365  |> following: 297  |> relationship ratio: 1.22
INFO [2019-05-05 13:45:39] [redacted]  --> Image was not able to get Liked! maybe blocked ?
INFO [2019-05-05 13:48:22] [redacted]  --> Invalid Like Element!

This continues.

The other accounts give me the following:

ERROR [2019-05-05 13:46:22] [redacted]  `followers_link` error list index out of range
INFO [2019-05-05 13:46:22] [redacted]  Grabbed 0 usernames from 'redacted's `Followers` to do interaction.
INFO [2019-05-05 13:46:22] [redacted]  User 'redacted' [2/35]

ERROR [2019-05-05 13:46:50] [redacted]  `followers_link` error list index out of range
INFO [2019-05-05 13:46:50] [redacted]  Grabbed 0 usernames from 'redacted's `Followers` to do interaction.
INFO [2019-05-05 13:46:50] [redacted]  User 'redacted' [3/35]
ERROR [2019-05-05 13:47:18] [redacted]  `followers_link` error list index out of range
INFO [2019-05-05 13:47:18] [redacted]  Grabbed 0 usernames from 'redacted's `Followers` to do interaction.

INFO [2019-05-05 13:47:18] [redacted]  User 'redacted' [4/35]

ERROR [2019-05-05 13:47:45] [redacted]  `followers_link` error list index out of range
INFO [2019-05-05 13:47:45] [redacted]  Grabbed 0 usernames from 'redacted's `Followers` to do interaction.
INFO [2019-05-05 13:47:45] [redacted]  User 'redacted' [5/35]

WARNING [2019-05-05 13:47:50] [redacted]  The page isn't available! ~the link may be broken, or the page may have been removed...
INFO [2019-05-05 13:47:50] [redacted]  Grabbed 0 usernames from 'redacted's `Followers` to do interaction.
INFO [2019-05-05 13:47:50] [redacted]  User 'redacted' [6/35]
ERROR [2019-05-05 13:48:08] [redacted]  `followers_link` error 
INFO [2019-05-05 13:48:08] [redacted]  Grabbed 0 usernames from 'redacted's `Followers` to do interaction.
INFO [2019-05-05 13:48:08] [redacted]  User 'redacted' [7/35]

What is interesting is that if I run the scripts with headless_browser=False and use the ChromeDriver then everything is absolutely fine. These errors seem to have come out of nowhere as everything was running absolutely fine and I was receiving no errors.

InstaPy configuration

I receive these errors using the script that I had configured as well as something simple like the
basic_follow-unfollow_activity script.

I have also tried a fresh venv with both a pip installation and the latest commit and I receive the same errors on both my scripts and one of the quickstart templates.

wontfix

All 12 comments

I've just realised that this is a possible duplicate of 4385.

This looks like it is an issue with the ChromeDriver. I have use_firefox=True and installed the Gecko driver and I have no issues.

Where do we install the gecko driver to get firefox to work? @SirCipher

Where do we install the gecko driver to get firefox to work? @SirCipher

@Kevdome3000 if you are on a Mac you can install using Brew: brew install geckodriver. Alternatively, you'll have to download the latest release and add the directory to your PATH.

@SirCipher i just installed it via "brew install geckodriver" on my mac,
then i added "use_firefox=True" here like this:

session = InstaPy(username=insta_username,
password=insta_password,
headless_browser=True,
use_firefox=True,
disable_image_load=True,
multi_logs=True)

but it's not working, is there anything i did wrong?

@SirCipher i just installed it via "brew install geckodriver" on my mac,
then i added "use_firefox=True" here like this:

session = InstaPy(username=insta_username,
password=insta_password,
headless_browser=True,
use_firefox=True,
disable_image_load=True,
multi_logs=True)

but it's not working, is there anything i did wrong?

What error are you getting?

What error are you getting?

Workspace in use: "/Users/NoOne/InstaPy"
Traceback (most recent call last):
File "quickstartfollowundollow.py", line 61, in
multi_logs=True)
File "/Users/NoOne/Documents/Instabot/InstaPy-master/instapy/instapy.py", line 295, in __init__
self.set_selenium_local_session()
File "/Users/NoOne/Documents/Instabot/InstaPy-master/instapy/instapy.py", line 347, in set_selenium_local_session
self.logger)
File "/Users/NoOne/Documents/Instabot/InstaPy-master/instapy/browser.py", line 75, in set_selenium_local_session
options=firefox_options)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/selenium/webdriver/firefox/webdriver.py", line 174, in __init__
keep_alive=True)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/selenium/webdriver/remote/webdriver.py", line 157, in __init__
self.start_session(capabilities, browser_profile)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/selenium/webdriver/remote/webdriver.py", line 252, in start_session
response = self.execute(Command.NEW_SESSION, parameters)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/selenium/webdriver/remote/webdriver.py", line 321, in execute
self.error_handler.check_response(response)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/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

@RhaegarTargaryen55 Have you got Firefox installed?

@SirCipher Wow, my bad, i thought it's installed but it's not. Seems like it works for me, thank you my friend!

@RhaegarTargaryen55 No problem! For anyone else wondering, Firefox must be installed and the minimum version satisfied.

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

If this problem still occurs, please open a new issue

Was this page helpful?
0 / 5 - 0 ratings

Related issues

drcyber975 picture drcyber975  路  3Comments

seuraltimez picture seuraltimez  路  3Comments

harrypython picture harrypython  路  3Comments

46960 picture 46960  路  3Comments

deronsizemore picture deronsizemore  路  3Comments