小编hem*_*aed的帖子

使用python获取instagram关注者列表

我编写的这段代码每 10 分钟给我 1000 个关注者,这是获得 1800 万关注者列表的缓慢过程。我想在更短的时间内访问 prada 的粉丝列表。感谢您的回复,缓慢的过程是 Instagram 限制错误。因此,请提供一种更快地获取关注者列表的方法。

 # 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())
Run Code Online (Sandbox Code Playgroud)

python python-3.x

8
推荐指数
1
解决办法
1万
查看次数

标签 统计

python ×1

python-3.x ×1