This script extracts all Tweets, Retweets, Images, Videos, Hashtags, Likes and Pinned tweet of a specific user in a .csv file.
- The system should have python and tweepy installed. Also, the user should have a Twitter developer account and a Twitter app (if you do not have one, create one at here). The use of Tweepy and need for a developer account is in accordance with the Twitter scraping rules.
- Chrome Driver (that matches your chrome version.) -- platform dependent.
- Create a Virtual Environment.
- Install the requirements by using
pip3 install -r requirements.txt
- Create a
.env
file like as.env.example
and add the credentials from the app created by you on twitter developer account. - Also add chrome driver path in .env file
- Hurray.! You're ready to use the script to extracts all Tweets, Retweets, Images, Videos, Hashtags and Likes of a specific user.
- Run the Script
python twitter_scrapper.py
- Enter the username you want the information from.
- Finally, you need to enter a Twitter username and password in order to extract the pinned Tweet (if it exists)
- The
.csv
file is downloaded to the folder where the file runs.