Tweet scraper using a particular hashtag without the intervention of twitter API
Here, we make use of snscrape to scrape tweets associated with a particular hashtag. Snscrape is a python library that scrapes twitter without the use of API keys.
In this script, we take the input of a hashtag and generate details associated with it (Eg., id, username, date, time, the tweet content, number of replies, likes, retweets, quotes and also its URL) tracing upto the desired number of tweets.
We store all this information in a .csv file with the selected file name.
Setup Instructions
Requirements
- snscrape library:
computer@computer:~$ pip install snscrape
- csv module: It comes built in with python
Working
The inputs user has to give:
.csv
file generated accordingly: