This Python script uses the ntscraper
library to scrape tweets from a specified Twitter user, download the associated images and videos, and create a CSV dataset.
- Scrapes tweets from a specified Twitter user
- Downloads images and videos embedded in the tweets
- Creates a CSV dataset with the tweet captions, hashtags, and media file names
- Python 3.x
- The following Python packages:
os
time
subprocess
requests
uuid
pandas
ntscraper
- Install the required packages by running
pip install -r requirements.txt
. - Update the
username
anddomain
variables in the script to your desired values. - Run the script using
python twitter_scraping.py
. - The script will create a CSV file in the current directory with the downloaded media files.