Skip to content

This project demonstrates web scraping of Twitter using Python and Selenium. The code logs in to Twitter, searches for tweets with a specific keyword, and extracts user data and tweet text. The scraped data is saved to a CSV file which then can be used for further analysis.

Notifications You must be signed in to change notification settings

zararashraf/TwitterScraper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 

Repository files navigation

Twitter Tweet Scraper

License

Description

The Twitter Tweet Scraper is a Python-based project designed to extract tweets from Twitter using Selenium and WebDriver. It allows users to specify search criteria, such as keywords or hashtags, and retrieve tweets from the Twitter platform. This project uses the Twitter website, simulating user interactions to access and scrape tweet data. The scraped data, including user information and tweet text, is then stored in a CSV file for analysis, research, or any other purpose.

Features

  • Automated scraping of tweets from the Twitter website.
  • Customizable search queries for specific topics, keywords, or hashtags.
  • Error handling to ensure robust performance.
  • Configurable variables for tweet count and user credentials.

Libraries and Technologies Used

  • Python 3.x
  • Selenium for web scraping and automation.
  • WebDriver for controlling the web browser.
  • Pandas for data manipulation and storage.
  • WebDriverWait for efficient synchronization with web page elements.

Usage

  1. Clone this repository: git clone https://github.com/zararashraf/TwitterScraper.git
  2. Install the required libraries: pip install selenium pandas
  3. Set your Twitter username and password in the script.
  4. Customize the search query and maximum tweet count as needed.
  5. Run the script: python main.py

Code Repository

You can access the source code for this project on GitHub.

Screenshots

image image

Credits

License

This project is licensed under the MIT License. Feel free to use, modify, and distribute the code while providing appropriate attribution.

About

This project demonstrates web scraping of Twitter using Python and Selenium. The code logs in to Twitter, searches for tweets with a specific keyword, and extracts user data and tweet text. The scraped data is saved to a CSV file which then can be used for further analysis.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages