A Python script to scrape liked tweets from a Twitter account using Selenium.
- Automatically logs into Twitter
- Navigates to the user's likes page
- Scrolls through and collects data from liked tweets
- Saves tweet data (username, tweet text, image URL, tweet URL) to a CSV file
- Python 3.x
- Selenium
- ChromeDriver
- pandas
- python-dotenv
- Clone this repository
- Install required packages:
pip install selenium pandas python-dotenv - Download ChromeDriver and update the path in the
.envfile - Create a
.envfile with your Twitter credentials and ChromeDriver path
Run the script: python twitter_scraper.py
This script is for educational purposes only. Be aware that web scraping may violate Twitter's terms of service. Use responsibly and at your own risk.