A web scraper that extracts quotes from quotes.toscrape.com and saves them to CSV.
- Scrapes quotes with author and tags
- Pagination support (scrape multiple pages)
- Filter by tag
- CSV output with clean formatting
- Respectful scraping with configurable delays
# Clone the repository
git clone https://github.com/souvikghosh/quote-scraper.git
cd quote-scraper
# Create virtual environment
python3 -m venv venv
source venv/bin/activate
# Install dependencies
pip install -e .# Scrape all quotes (all pages)
quote-scraper
# Scrape first 3 pages only
quote-scraper --pages 3
# Scrape quotes with a specific tag
quote-scraper --tag love
# Custom output file
quote-scraper --output my_quotes.csvThe CSV file contains three columns:
| Column | Description |
|---|---|
| text | The quote text |
| author | The author's name |
| tags | Pipe-separated list of tags |
Example:
text,author,tags
"The world as we have created it is a process of our thinking.",Albert Einstein,change|deep-thoughts|thinking|world$ quote-scraper --pages 2 --output sample.csv
Starting scrape...
Scraping page 1...
Scraping page 2...
Saved 20 quotes to sample.csv
MIT