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/Linuxpip install -r requirements.txtin root dir paste file named x.com.cookies.json
touch x.com.cookies.json
python main.py
