Skip to content

Instantly share code, notes, and snippets.

@thezakman
Last active May 10, 2021 02:18
Show Gist options
  • Save thezakman/527aa88afec841dc0a447d32b6ec75ad to your computer and use it in GitHub Desktop.
Save thezakman/527aa88afec841dc0a447d32b6ec75ad to your computer and use it in GitHub Desktop.
# pip install instaloader
import instaloader
L = instaloader.Instaloader()
# Change for the Instagram profile you want the followers list
profile = "TheZakMan"
# Use your credentials to load session
username = "YourUsername"
password = "YourPassword"
L.login(username, password) # (login)
# Obtain profile metadata
profile = instaloader.Profile.from_username(L.context, profile)
# Print list of followers
follow_list = []
count = 0
for followee in profile.get_followers():
follow_list.append(followee.username)
file = open("followers.txt", "a+")
file.write(follow_list[count])
file.write("\n")
file.close()
print(follow_list[count])
count = count + 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment