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.
β
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)
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
- Python 3.10+
- Selenium
- Pandas
git clone https://github.com/amadirfan/XBot.git
cd XBotpython -m venv venv venv\Scripts\activate # On Windows # OR source venv/bin/activate # On macOS/Linux
pip install -r requirements.txt
in root dir paste file named x.com.cookies.json
touch x.com.cookies.json
python main.py