Skip to content

StathisP-s/php-book-crawler

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

2 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ“š PHP Book Scraper & Crawler

A simple PHP web app that scrapes books from books.toscrape.com, including multiple pages and categories.

πŸ” Features

  • 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

πŸš€ Demo

Run locally with XAMPP or any PHP server

  1. Clone or download this repo
  2. Place folder inside htdocs/ (if using XAMPP)
  3. Start Apache and visit http://localhost/php-book-crawler/index.php
  4. Choose a category and click "Scrape"

πŸ“¦ Requirements

  • PHP 7.4+
  • cURL enabled
  • DOM extension (default in PHP)

πŸ“ Folder Structure

php-book-crawler/ β”œβ”€β”€ index.php β”œβ”€β”€ scrape.php β”œβ”€β”€ scraper/ β”‚ └── BookScraper.php β”œβ”€β”€ exports/ β”‚ └── books.csv

πŸ”’ 2. .gitignore

exports/books.csv *.log

πŸ”§ Technologies Used

  • PHP 8+
  • DOMDocument
  • Simple HTML DOM Parser (προαιρΡτικά)
  • Bootstrap (Ξ³ΞΉΞ± το UI)

About

A simple PHP web scraper for books.toscrape.com (multi-page & category aware)

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published