PyTweetCli is a lightweight Python script for seamless Twitter tweet retrieval using Selenium via the command line. Easily fetch tweets by username or keyword with simplicity and efficiency.
- Command-line interface for quick tweet retrieval
- Fetch tweets by username, keyword or link
- Lightweight and user-friendly
To run pyTweetCli, you need to have the following dependencies installed:
- Python 3.11.6
- Selenium
- Pandas
- Clone the repository:
git clone https://github.com/imbngy/pyTweetCli.git- Navigate to the project directory:
cd pyTweetCli- Install requirements:
pip install -r requirements.txt- Run the script:
py main.pyThe script will launch a headless Chrome browser, navigate to twitter.com, and scrape tweets by given input.
You can run the script with:
py main.pyor by adding a link argument:
py main.py -l https://twitter.com/tweet-link/exampleBoth cases it will ask you for a username, or email, and a password:
Enter your username/email:
Enter your password:When you don't pass an argument, it will ask if you want to search by keyword or by user:
Select a search mode:
1. Search by keyword
2. Search by user
Enter a number:When searching by user, simply put whatever comes after the @, for example:
Enter the desired username: elonmuskPyTweetCli provides output in two ways:
- CSV File: The script generates a CSV file with the fetched tweet data.
- Command Line: The fetched tweets are also displayed in the command-line interface.
Enhance your tweet harvesting experience with PyTweetCli!
Found a bug or have a suggestion? Open an issue or contribute to make PyTweetCli even better.