This project contains Python scripts designed for extracting specific hashtags from Twitter. The scripts leverage web scraping and API integration to identify and gather data related to targeted hashtags.
The repository includes the following Python files:
- TwitterMiner.py: A script that uses Twitter API to fetch and filter tweets containing specific hashtags.
- twitterWebScrapper.py: A web scraper that extracts tweets with specific hashtags from Twitter’s web interface.
These tools can be used individually or combined to gather hashtag data for analysis, research, or monitoring trends.
Ensure the following dependencies are installed before running the scripts:
- Python 3.6+
- Tweepy (if using Twitter API)
- BeautifulSoup4 (if web scraping)
- Requests
- Selenium (for web scraping with dynamic content)
Install the dependencies using:
pip install tweepy beautifulsoup4 requests selenium
This script uses the Twitter API to collect tweets with specific hashtags. Ensure you have a valid Twitter Developer Account and API credentials set up:
- API Key
- API Secret Key
- Access Token
- Access Token Secret
- Replace the placeholder credentials in the script with your own.
- Run the script:
python TwitterMiner.py
- Specify the hashtags and other parameters as needed.
This script uses web scraping to gather tweets containing specific hashtags from Twitter’s public web pages.
- Ensure Selenium WebDriver (e.g., ChromeDriver) is installed and set up.
- Run the script:
python twitterWebScrapper.py
- Modify the script to specify the hashtags and search parameters.
Ensure that your use of these scripts complies with Twitter’s terms of service and data privacy regulations. Excessive scraping or misuse of API resources can lead to your account being suspended.
For questions or suggestions, feel free to reach out:
Happy coding and hashtag hunting! 🚀