I got the following error:
I used this code:
import snscrape.modules.twitter as sntwitter
import pandas as pd
import re
# Setting variables to be used below
maxTweets = 350000
# Creating list to append tweet data to
tweets_list1 = []
user_list = ['lanacionmas','LANACION','Ambitocom','infobae','clarincom']
# Using TwitterSearchScraper to scrape data and append tweets to list
for user in user_list:
for i,tweet in enumerate(sntwitter.TwitterSearchScraper('from:' + user +' since:2018-01-01 until:2018-12-31').get_items()):
if i>maxTweets:
break
tweets_list1.append([tweet.date, tweet.id, tweet.content])
print('Done' + user)
Do you know how to fix this error?
Thanks a lot!
Feel like your lucky day, because I created an account here just to reply to you.
In in this issue, the module creator explains what happened and how to solve the problem, but you just need add top=True
in commands that have Twitter**Scraper, or if you are using it from the command line, use the flag --top
(I just found out that I could have posted as a guest)