0

Instaloader didn't work as expectation. I write a for loop to loop through likes in a post and grap the liker's username, however the return amount of people is less than actual likes. I was wondering what leads to this happen.

my code

if __name__ == '__main__':
data =[]
L=instaloader.Instaloader()
L.login(username, pw)
Post = instaloader.Post.from_shortcode(L.context,shortcode)
print(Post['likes'])
i=0;
for like in Post.get_likes():
    #data.append(like.userid)
    i+=1
# df = pd.DataFrame(data,columns=['Username'])
#print(df)
print(i)
#df.to_csv('file_name.csv')

I have 563 likes in total. However print(i) only shows 510, does anyone know how to solve the issue?

lok cheng
  • 15
  • 4

0 Answers0