Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
/ XBot Public

XBot is an automated scraping bot built with Python, Selenium, and pandas that extracts tweets and user data from X (Twitter) using browser automation. It supports authentication via saved cookies (exported using a Chrome extension) and saves results to structured CSV files

Notifications You must be signed in to change notification settings

AmadIrfan/XBot

Repository files navigation

XBot

XBot is an automated scraping bot built with Python, Selenium, and pandas that extracts tweets and user data from X (Twitter) using browser automation.
It supports authentication via saved cookies (exported using a Chrome extension) and saves results to structured CSV files.

πŸš€ Features

βœ… Extracts usernames, tweet text, and like counts
βœ… Uses Selenium for automated browser control
βœ… Supports cookie-based authentication (no manual login each time)
βœ… Saves data as CSV using pandas
βœ… Organized OOP structure (Auth, Driver, Scraper, Save)

πŸ“ Project Structure

App

Bot/
β”œβ”€β”€ auth/
β”‚ β”œβ”€β”€ __init__.py
β”‚ └── authentication.py
β”œβ”€β”€ cookies/
β”‚ β”œβ”€β”€ __init__.py
β”‚ └── cookies_manager.py
β”œβ”€β”€ driver/
β”‚ β”œβ”€β”€ __init__.py
β”‚ └── webdriver_manager.py
β”œβ”€β”€ scraper/
β”‚ β”œβ”€β”€ __init__.py
β”‚ └── twitter_scraper.py
│── model.py
β”œβ”€β”€ x.com.cookies.json
β”œβ”€β”€ images/
| └── img
β”œβ”€β”€ *.csv
β”œβ”€β”€ requirements.txt
β”œβ”€β”€ main.py
└── README.md

Pictures

Processing

Finish

🧩 Tech Stack

  1. Python 3.10+
  2. Selenium
  3. Pandas

βš™οΈ Setup Instructions

1. Clone the repository

git clone https://github.com/amadirfan/XBot.git
cd XBot

2. Create and Activate Python Virtual Environment

python -m venv venv
venv\Scripts\activate # On Windows
# OR
source venv/bin/activate # On macOS/Linux

3. Install dependencies

pip install -r requirements.txt

4. Set Cookies

in root dir paste file named x.com.cookies.json

touch x.com.cookies.json

5. Run Code

python main.py

About

XBot is an automated scraping bot built with Python, Selenium, and pandas that extracts tweets and user data from X (Twitter) using browser automation. It supports authentication via saved cookies (exported using a Chrome extension) and saves results to structured CSV files

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

AltStyle γ«γ‚ˆγ£γ¦ε€‰ζ›γ•γ‚ŒγŸγƒšγƒΌγ‚Έ (->γ‚ͺγƒͺγ‚ΈγƒŠγƒ«) /