Hello! I'm using snscrape.modules.twitter to scrape new tweets from users, but I'm having a problem, I can't find the user's retweets, only their original tweets. Maybe I'm doing something wrong, does snscrape have such an option? Here is my code:
import snscrape.modules.twitter as sntwitter
def get_latest_tweets(username, num_tweets):
tweets = []
for tweet in sntwitter.TwitterUserScraper(username).get_items():
if tweet.inReplyToUser is None:
tweets.append(tweet)
if len(tweets) >= num_tweets:
break
return tweets
username="elonmusk"
num_tweets = 5
latest_tweets = get_latest_tweets(username, num_tweets)
for tweet in latest_tweets:
print(tweet.rawContent)
print("---")
print()
print("---")
Hello! I'm using snscrape.modules.twitter to scrape new tweets from users, but I'm having a problem, I can't find the user's retweets, only their original tweets. Maybe I'm doing something wrong, does snscrape have such an option? Here is my code: