JustAnotherArchivist / snscrape

A social networking service scraper in Python
GNU General Public License v3.0
4.33k stars 699 forks source link

Scraping Tweets with retweet and favourite counts #170

Closed rampager525 closed 3 years ago

rampager525 commented 3 years ago

Hi. I have been using snscrape ever since GetoldTweets3 doesn't work. This is the code that I am using now:

for i,tweet in enumerate(sntwitter.TwitterSearchScraper('from:jack').get_items()):
    if i>maxTweets:
        break
    tweets_list1.append([tweet.date, tweet.id, tweet.content, tweet.user.username])

# Creating a dataframe from the tweets list above
tweets_df1 = pd.DataFrame(tweets_list1, columns=['Datetime', 'Tweet Id', 'Text', 'Username'])

# Display first 5 entries from dataframe
tweets_df1.head()

While scraping the tweets, can I also scrape the retweet and favourite counts into the dataframe?

JustAnotherArchivist commented 3 years ago

Duplicate of #138