【发布时间】:2023-02-20 21:42:53
【问题描述】:
我想运行这段代码
def get_all_tweets(屏幕名称):
#initialize a list to hold all the tweepy Tweets
alltweets = []
#make initial request for most recent tweets (200 is the maximum allowed count)
new_tweets = api.user_timeline(screen_name = screen_name,count=200)
#save most recent tweets
alltweets.extend(new_tweets)
#save the id of the oldest tweet less one
oldest = alltweets[-1].id - 1
while len(new_tweets) > 0:
new_tweets = api.user_timeline(screen_name = screen_name,count=200,max_id=oldest)
#save most recent tweets
alltweets.extend(new_tweets)
# print(alltweets[-1]['id'])
#update the id of the oldest tweet less one
oldest = alltweets[-1].id - 1
TweepError Traceback(最后一次调用) 在 用户名中的 x 为 221: 第222章 --> 223 用户信息=get_all_tweets(x)
224 all_fet.append(compute_features(x,user_info))
225 #
2帧 /usr/local/lib/python3.8/dist-packages/tweepy/binder.py 在 execute(self) 第232回 233 其他: --> 234 raise TweepError(error_msg, resp, api_code=api_error_code) 235 236 # 解析响应负载
TweepError: [{'code': 34, 'message': '抱歉,该页面不存在。'}]
如何解决这个问题?
【问题讨论】:
标签: python python-3.x api twitter tweepy