Loop to search Twitter for various elements of a list using tweepy

Asked

Viewed 19 times

0

I am using tweepy to return 20 tweets from each user in INF_LIST. I’m trying to do this by way of a loop so that it covers all users. However, it seems that the program returns only the last user’s search.

From now on, thank you!

saida = []
for users in inf_list:
    busca =  users
    data = "2021-04-12"
    busca_tt = busca + " -filter:retweets"
    tweets = tw.Cursor(api.search,
              q=busca_tt,
              lang="pt-br",
              since=data).items(20)
    saida.append(tweets)
print (saida)
No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.