This code that i have written gives me 1000 followers per 10 minute which is a slow process for getting 18 million follower list. I would like to have access to prada's follower list in shorter amount of time.thanks for your replies the slow process is instagram limitations fault. So give a way to get the follower list faster.
# Get instance
import instaloader
L = instaloader.Instaloader()
# Login or load session
L.login(username, password) # (login)
# Obtain profile metadata
profile = instaloader.Profile.from_username(L.context, "prada")
# Print list of followees
follow_list = []
count=0
for followee in profile.get_followers():
follow_list.append(followee.username)
file = open("prada_followers.txt","a+")
file.write(follow_list[count])
file.write("\n")
file.close()
print(follow_list[count])
count=count+1
# (likewise with profile.get_followers())
Open a terminal or cmd again and run the bot using this command: python run.py . Enter the username of the person whose followers you want to scrape. Enter how many followers you want to scrape. And that's it.
This first option is easy: just go to your profile on Instagram – the URL www.instagram.com/yourusername – and click on the “# followers” label up a the top. This will pop up a lightbox that will show you several pieces of information. The username of each person who follows you.
Sign in instagram and open the extension. 2. Select or input the IG user you want to export, choose the export type then click 'GO'.
Main bottleneck may be pulling the data from instagram, but you can improve speed by opening and closing only once outside of the loop; also you don't really need the array:
file = open("prada_followers.txt","a+")
for followee in profile.get_followers():
username = followee.username
file.write(username + "\n")
print(username)
file.close()
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With