A professional intermediate-level web scraping project built with Python, BeautifulSoup, Requests, SQLAlchemy, and SQLite.
- Web scraping using Requests
- HTML parsing using BeautifulSoup
- Multi-page scraping
- Rate limiting
- Retry mechanism with exponential backoff
- Logging with Loguru
- Data validation
- CSV export
- JSON export
- SQLite database storage
- Duplicate prevention
- Command-line interface (CLI)
Website
│
▼
Fetcher
│
▼
Parser
│
▼
Extractor
│
▼
Validator
│
▼
SQLite Database
│
├── CSV Export
└── JSON Export
web_scraper/
│
├── config/
│ └── settings.py
│
├── scraper/
│ ├── fetcher.py
│ ├── parser.py
│ ├── extractor.py
│ └── pipeline.py
│
├── database/
│ ├── db.py
│ ├── models.py
│ ├── crud.py
│ └── init_db.py
│
├── utils/
│ ├── exporter.py
│ ├── logger.py
│ └── validator.py
│
├── data/
│ └── exports/
│
├── logs/
│
├── screenshots/
│
├── main.py
├── check_db.py
├── requirements.txt
├── README.md
└── .gitignore
Clone repository:
git clone <repository-url>
cd web_scraperCreate virtual environment:
python -m venv venvActivate:
Windows:
venv\Scripts\activateInstall dependencies:
pip install -r requirements.txtScrape 5 pages:
python main.py --pages 5Scrape 10 pages:
python main.py --pages 10Display help:
python main.py --helpInitialize database:
python -m database.init_dbCheck stored records:
python check_db.pyFetching...
Found 20 books
Waiting 2.14s
Fetching...
Found 20 books
Saved 100 books
- Python
- Requests
- BeautifulSoup4
- SQLAlchemy
- SQLite
- Pandas
- Loguru
- Git
- GitHub
- Playwright Integration
- Proxy Rotation
- Docker Support
- GitHub Actions CI/CD
- MongoDB Support
- Async Scraping
Samyak Mahatme