IG Changed there Website again. Now when you try to unfollow, a dialog appears asking if you really want to unfollow. Dont know if this is some Kind of Bot protection, but the unfollow is not working anymore.
@torbenberger i made a pr soon for this
basically everytime we call
if following:
# click the button
click_element(browser, follow_button) # follow_button.click()
sleep(4)
we need to insert
try:
browser.find_element_by_xpath("//button[contains(text(), 'Unfollow')]").click()
sleep(1)
except Exception,e:
pass
thanks, but its not working for me:
unfollow_util.py", line 282
try: browser.find_element_by_xpath("//button[contains(text(), 'Unfollow')]").click() sleep(1) except Exception,e: pass
@Tidle999 you see the pr ?
maybe the code you copy / paste is wrong ?
yes i'v seen it.
i double checked, but now i got another error:
Sorry, an error occured: unfollow() missing 1 required positional argument: 'logfolder'
i didi it like this:
if following:
# click the button
click_element(browser, follow_button) # follow_button.click()
sleep(4)
try:
browser.find_element_by_xpath("//button[contains(text(), 'Unfollow')]").click() sleep(1)
except Exception,e:
pass
# double check not following
follow_button = browser.find_element_by_xpath(
"//*[contains(text(), 'Follow')]")
@ilmetu Good job , how u figure it out ? is it possible from Google Chrome ? i mean from where u find this
browser.find_element_by_xpath(
"//*[contains(text(), 'Follow')]")
@Tidle999 i think the indentation is wrong:
```if following:
# click the button
click_element(browser, follow_button) # follow_button.click()
sleep(4)
try:
browser.find_element_by_xpath("//button[contains(text(), 'Unfollow')]").click()
sleep(1)
except Exception:
pass
# double check not following
follow_button = browser.find_element_by_xpath(
"//*[contains(text(), 'Follow')]")```
got it! thanks, its working for me now! =)
ok sorry again, but i thinks its not stable, at least for me. i downloaded the complete pr, so im pretty sure im fine with the code.
but after some unfollowings chrome is closing (directly after hitting the unfollow button from the new "are you sure" dialog)
in the script i just have the following error:
"ERROR [2018-07-03 10:40:35] [USERNAME] Unfollow error! ~username USERNAME might be blocked"
if i do it manually its working.
edit:
i have tested it about 20 times now, sometimes its happening on the first unfollwing, sometimes the second or thrid. but its not getting further.
@Tidle999 i'm sorry to hear that , but i think it's not related to my changes, because is sourrounded with try catch .
In my environment everything works fine ...
the error you intercept is based on the check:
if follow_button.text in ['Follow','Follow Back']:
...
else:
logger.error("unfollow error username {} might be blocked ".format(username))
isn't is old thing ?
I have also the same issue like @Tidle999 ...
@sionking what is the solution if it is an old issue? i can't find it...thanks a lot for the support
@sionking @ilmetu @Tidle999 @cormo1990
in my code i changed this
else:
logger.error("Unfollow error! ~username {} might be blocked\n".format(person))
# stop the loop
continue # this was break.
I thinks is a logic error, because if this happen we don't want to break all the unfollow loop, but just ignore this element
@sionking @ilmetu @marcomokastyle
I had this same issue. Fixed it by changing the sleep time to 4 seconds instead of 1. After clicking pop-up, not enough time is given for "Follow" or "Follow Back" to appear and this then causes the error. See snippet below.
try:
browser.find_element_by_xpath("//button[contains(text(), 'Unfollow')]").click()
sleep(4) #Change this from 1 second to allow time for IG to do its thing, probably only an issue on slower connections.
except Exception:
pass
@sionking @ilmetu @Tidle999 @cormo1990 @BenDixon89
I still have to test, because I'm not in the unfollow phase yet, but if I try to unfollow someone normally in Chrome, I don't see the popup, maybe is related to the language? I'll see if is different through selenium. (that is in English by default)
@marcomokastyle
I also never had it before. I believe it is something that was recently added as another bot protection measure. But they obviously have an watch on high activity users. I only have it popping up from today after I moved my bot to a google server where it runs much faster. Actually had to throttle it back a bit since I was getting temporarily blocked from following users.
@BenDixon89
Could be for that reason indeed. I use InstaPy with very low limits, just 15/16 follows per hour, and I run the bot on an old laptop, so it run sloooow haha. But for me, is good enough.
@sionking i try to modify like your suggestion, the unfollow continue but not unfollow user, skip to the next one and write the same message the user is blocked
@sionking it might be that you need even more sleep time for your internet connection. Open a chrome browser and look at the experience yourself then decide what the logic for bot has to be.
Probably all solved with the file suggested by @ilmetu
@cormo1990 Not actually, this exactly what I implemented. Also has some platform issues as highlighted by other users on python3.
@BenDixon89 yes, in my case works but i don't know why after 6 or 7 unfollowed user happened the same error....i don't know what to do...
@cormo1990 maybe the best thing to do is wait a week until after the smart people who also use Instagram realize that this must be fixed because ignoring the issue doesn't fix it. Then, once they fix it for themselves, just download the new code from the site and you will be back in business. It's the tradeoff for using a free solution.
i added some sleep time to avoid problems with slower connections . https://github.com/timgrossmann/InstaPy/pull/2364
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