首页 > 解决方案 > 获取与特定 IG 页面互动最多的关注者列表

问题描述

我想获取页面上点赞和评论最多的用户的信息。例如,与页面互动最多的 100 位顶级关注者。

我使用 Instaloader 存储库并使用以下代码,我能够获取页面的关注者列表。但我不知道找到对该页面参与度最高的关注者

import instaloader
from instaloader import Profile

username="my_username"
password="my_password"

L = instaloader.Instaloader()
L.login(username, password)

target = 'target_page_for_scrape_followers'

profile = instaloader.Profile.from_username(L.context, target)

file = open(target + '_followers.txt', "a+")
print(file)
for followers in profile.get_followers():
   username = followers.username
   file.write(username + "\n")
print(profile)


print(username)
file.close()

print("***************************************************************************************** \n")

我怎样才能做到这一点?提前感谢任何可以帮助我的人。

标签: pythonweb-scrapinginstagraminstagram-api

解决方案


推荐阅读