InstaPy / InstaPy

📷 Instagram Bot - Tool for automated Instagram interactions
GNU General Public License v3.0
16.85k stars 3.78k forks source link

Grabbed 0 usernames from "username" to do interaction #3085

Closed Tachenz closed 5 years ago

Tachenz commented 6 years ago

With recent pull - Grabbed 0 usernames from "username" to do interaction started to happen, when using "interact with user followers". At the same, in browser window, I can see as the script scrolls through the user followers - but for some reason it is not getting any of them....

@uluQulu Any ideas why this may be happening?

And sometimes, it would actually get 8-10 users, but never more than that (even though) it scrolled through like 50-100... There are a lot of people here with this issue...

HCWcoder commented 6 years ago

Im having the same issue sometimes ! @uluQulu @sionking

sionking commented 6 years ago

Sure the structure was changed for 10% of users. i think this is it ?

sionking commented 6 years ago

I also start experience it

HCWcoder commented 6 years ago

What is the problem is it for all users or ?

Tachenz commented 6 years ago

Just for some users. It is also interesting, as it is NOT some sort of temporary block from Instagram. In both cases when script can and can not grab users for interaction, - if you watch the browser window, it keeps scrolling AS IF users are being collected. Could it be it started randomly changing Element Names? Wanted to add, that ALSO - if I que say 20 usernames, it would go fine for some of them, and have this message for the others

HCWcoder commented 6 years ago

how can we debug this ? @sionking @uluQulu

sionking commented 6 years ago

I am on it.

sionking commented 6 years ago

the issue: posts_count = get_number_of_posts(browser)

the issue is already solved here: https://github.com/timgrossmann/InstaPy/pull/3070

But we better use graphql approach.

Tachenz commented 6 years ago

@sionking Thank you, will test it soon!

Just to be clear - this solution u offered, it deals with grabbing post for user, right? Above problem occurs when getting user followers to interact with (but maybe it is the same mechanism)

HCWcoder commented 6 years ago

@Tachenz yes this is what i was going to say! please update here if it solves our issue! thanks.

sionking commented 6 years ago

oops :)

Tachenz commented 6 years ago

Guys, tried it - it does nothing for grabbing usernames to interact with, unfortunately :(

HCWcoder commented 6 years ago

@Tachenz Thanks for the update!

@sionking any clews about this issue ?

Tachenz commented 6 years ago

@timgrossmann - this issue affects that workflow, when you interact with other user followers... It can go around, skipping (grabbing 0 from each) for 10-20 users at a time, till finally getting maybe 7 or 10 followers to work with. So having a long list of users to start with - does not help anymore... renders this method unusable, unfortunately :(

oridamari commented 6 years ago

Fixed it. but i think we should implement it differently. what the code currently does - takes all the buttons with the "follow" text, and then for each one does xpath of "../../../" and then takes the second "a" element. the bug was that instagram changed the first "a" sometimes to be span (i think if the person has story - the first "a" changed to span)

i think this is very slow and complicated, but here is the fix for now:

unfollow_util.py

change the method there to -

def dialog_username_extractor(buttons):
    """ Extract username of a follow button from a dialog box """

    if not isinstance(buttons, list):
        buttons = [buttons]

    person_list = []
    for button in buttons:
        if button and hasattr(button, 'text') and button.text:
            try:
                links = button.find_element_by_xpath("../../../*") .find_elements_by_tag_name("a")
                username = links[0].text
                if (len(links) > 1):
                    username = links[1].text
                person_list.append(username)
            except IndexError:
                pass  # Button doesn't have "a" element

    return person_list
Tachenz commented 6 years ago

@orisust Thank you - trying it now! For now it does grab users, but that annoying thing when it grabs only 12 users, no matter how much you asked it to grab -still present (I realise though that this was a fix for the 0 issue, 12 is much better than 0 :D )

oridamari commented 6 years ago

@Tachenz i have just grabbed 600 users after the change... before it was between 0 to 10 Does it scroll down ?

Tachenz commented 6 years ago

@orisust Hm... it just looks like sometimes it works and sometimes it does not, for some reason... I am on the second user at the moment - and it is 12 again. Weird thing is - that it definitely scrolled like 20 screens of those users, to just get 12 (I have 300 asked for).

oridamari commented 6 years ago

@Tachenz my guess is you don't have the "a" element in the place the xpath is looking for... so you should investigate it yourself :) try to check one of the 12's html code("li" item) and compare it to one of the users he didn't fetch html code, to see the difference. if you need help you can paste here

Tachenz commented 6 years ago

Got it! Will try to take a look :)

Tachenz commented 6 years ago

And the bug is back with the full force, even with the latest update... Grabbed 0 users for interaction...

uluQulu commented 6 years ago

Hi @Tachenz The fix- e692436 from #3226 might also fix this problem. Just pull master once more and let me know.


Cheers 🙂

Tachenz commented 6 years ago

Trying now!!

On Mon, Oct 29, 2018 at 4:27 PM Şəhriyar Cəfər Qulu < notifications@github.com> wrote:

Hi @Tachenz https://github.com/Tachenz The fix- e692436 https://github.com/timgrossmann/InstaPy/commit/e69243695a069d870bef4faf42864f9ed6d4313f from #3226 https://github.com/timgrossmann/InstaPy/pull/3226 might also fix this problem. Just pull master once more and let me know.

Cheers 🙂

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/timgrossmann/InstaPy/issues/3085#issuecomment-433976163, or mute the thread https://github.com/notifications/unsubscribe-auth/AiZwPqa_RGyIQ__c5G-xec4efY7gXO7Zks5upyxmgaJpZM4XKTVw .

Tachenz commented 6 years ago

@uluQulu Sadly it did not fix it :( Same Grabbed 0 username from xxxx for interactions. Username after username - failed to load desired amount of users... Just gets to "Suggestions" and stops scrolling untitled - That is with the very last version of the script

Yaxit commented 6 years ago

Same issue here

stale[bot] commented 5 years ago

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

Tachenz commented 5 years ago

Still having this issue :(

stale[bot] commented 5 years ago

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

Julio-Maldonado commented 5 years ago

has anybody here realized a solution to this?

fadsel commented 2 years ago

Well it's 2022 and we are back here again