我很确定这是一个相当简单的操作,但在搜索了其他问题和过时的 tweepy 文档之后,我放弃了。我正在尝试制作一个自动跟踪脚本...这就是我到目前为止所拥有的。
def follow_back():
followers=[api.followers()]
following=[api.friends()]
for follower in followers:
if(follower in following):
print('did nothing for one person')
else:
api.create_friendship(follower)
print('followed one person')
我收到“页面不存在”tweepy 错误。
最佳答案
你的语法错误
api.create_friendship(follower)
使用类似的东西
api.friendship.create(follower)
您还可能需要定义是否向关注者请求 screen_name 或用户 ID ( _ID )。
关于python - 在 Tweepy 中创建自动跟进脚本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20894511/