First, thank you so much for this excellent project!
I have been able to get things working however, I am getting some errors when introduce commenting and unfollow. Here is my quickstart:
from instapy import InstaPy
import os
session = InstaPy(username='xxxx', password='xxx')
session.login()
session.set_do_follow(enabled=True, percentage=35, times=1)
session.set_do_comment(enabled=True, percentage = 35)
session.set_comments(['Love This!', 'This is great!'])
session.set_dont_like('[porn', '#sex')
session.unfollow_users(amount=10)
session.like_by_tags(['design'], amount=5)
session.end()
Here is the error I get related to commenting:
--> Warning: Comment Action Likely Failed: Comment Element not found
Interestingly, it still gets marked as "Commented", but if I go to the profile, I do not see a comment.
Here is the error I get related to unfollowing:
Traceback (most recent call last):
File "quickstart.py", line 11, in <module>
session.unfollow_users(amount=10)
File "C:\Users\Maarten\Desktop\InstaPy-master\instapy\instapy.py", line 477, in unfollow_users
amount -= unfollow(self.browser, self.username, amount, self.dont_include)
File "C:\Users\Maarten\Desktop\InstaPy-master\instapy\unfollow_util.py", line 13, in unfollow
following_link_div = browser.find_elements_by_class_name('_218yx')[2]
IndexError: list index out of range
Any help is greatly appreciated, and thank you in advance!
I was reviewing issue #288. When I observe the browser, I do not see the "Add Comment..." area (see below). I believe this is why I am getting the error. Is there a way to fix this?
Also still having issue with unfollow.

How many people where you following, when the unfollowing error occurred? Maybe 0 ?
Thanks for the reply. I had well over 50 followers.
Your comment did make me think that when I was testing everything I was only going through about 5-10 images to like (see quickstart above) and the unfollow amount=10. When I lowered the unfollow to amount=2, I had no issues! Also, when I increased the amount of images to go through and set the unfollow to amount=10, I had no issues! Therefore, I consider this resolved. Thank you for your help.
I am still trying to tackle the commenting issues.
Any update on the commenting? I am having the same problem where it says commented but no comments are actually written on the user's image
@lestergan88 Ok, So the commenting element didn't load on the page. I'm not sure if there is a way to fix that unless if the element isn't found... we refresh the post to try and find it again. Other than that Script probably just has to skip commenting on that post. It almost seems like a soft ban thing.
I am encountering the same issue when I run from my rpi3 using Firefox. If I run the same quickstart.py file from macbook using Chrome it runs fine. However, it is not taking the type of media into account.
InstaPy()\
.login()\
.set_upper_follower_count(limit = 2500) \
.set_do_comment(True, percentage=75) \
.set_comments(['Sweet pic!', 'Sweet!'], media='Photo') \
.set_comments(['Sweet vid!', 'Nice edit!'], media='Video') \
The script posts comments meant for video on photos. I'm wondering if the commenting error is related to running it headless using xvfb? How are you running it? When it does comment, is it taking the media type into account correctly?
@timgrossmann any ideas about the media not being accounted for in the above?
I'm encountering the same issue as @gitpatrickhub.
@gitpatrickhub @andrewjburnett I'll try to find some time looking into this
Most helpful comment
@gitpatrickhub @andrewjburnett I'll try to find some time looking into this