You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi guys! im new to coding and I was reading documentation and build this script to get list of followers
but I keep getting errors. Can some one please explain me what im doing wrong and why?
from instagram_private_api import Client, ClientCompatPatch
user_name = '***'
password = '***'
api = Client(user_name, password)
from random import randint
from time import sleep
user_id = api.username_info('target')['user']['pk']
# Create a list of followers' usernames
usernames = []
next_max_id = followers.get('next_max_id')
while next_max_id:
delay = randint(20,40)
print("Sleep " + str(delay) + "s")
sleep(delay)
# Get a list of the user's followers
followers = api.user_followers(user_id, rank_token=api.generate_uuid(),)
next_max_id = followers.get('next_max_id')
for follower in followers['users']:
usernames.append(follower['username'])
# Print the list of followers' usernames
print(len(usernames))
print(usernames)
The text was updated successfully, but these errors were encountered:
Hi guys! im new to coding and I was reading documentation and build this script to get list of followers
but I keep getting errors. Can some one please explain me what im doing wrong and why?
The text was updated successfully, but these errors were encountered: