[Python] Python. TweepError: [{'code': 34, 'message': 'Sorry, that page does not exist.'}]

Discussão em 'Python' iniciado por Stack, Março 17, 2025.

  1. Stack

    Stack Membro Participativo

    I want to run this code

    def get_all_tweets(screen_name):

    #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 (most recent call last) in 221 for x in usernames: 222 print(x) --> 223 user_info=get_all_tweets(x)

    224 all_fet.append(compute_features(x,user_info))
    225 #


    2 frames /usr/local/lib/python3.8/dist-packages/tweepy/binder.py in execute(self) 232 raise RateLimitError(error_msg, resp) 233 else: --> 234 raise TweepError(error_msg, resp, api_code=api_error_code) 235 236 # Parse the response payload

    TweepError: [{'code': 34, 'message': 'Sorry, that page does not exist.'}]

    How to fix this problem?

    Continue reading...

Compartilhe esta Página