A simple PHP web app that scrapes books from books.toscrape.com, including multiple pages and categories.
- Select category from dropdown
- Crawls all pages of that category
- Extracts:
- Book title
- Price
- Availability
- Book link
- Exports to CSV
- Displays results in responsive Bootstrap table
Run locally with XAMPP or any PHP server
- Clone or download this repo
- Place folder inside
htdocs/(if using XAMPP) - Start Apache and visit
http://localhost/php-book-crawler/index.php - Choose a category and click "Scrape"
- PHP 7.4+
- cURL enabled
- DOM extension (default in PHP)
php-book-crawler/ βββ index.php βββ scrape.php βββ scraper/ β βββ BookScraper.php βββ exports/ β βββ books.csv
π 2. .gitignore
exports/books.csv *.log
- PHP 8+
- DOMDocument
- Simple HTML DOM Parser (ΟΟΞΏΞ±ΞΉΟΞ΅ΟΞΉΞΊΞ¬)
- Bootstrap (Ξ³ΞΉΞ± ΟΞΏ UI)