RubyintermediateaiAI generated

Web Scraper for Book Prices with Nokogiri

Build a Ruby scraper that visits book listing pages, extracts titles, prices, and availability using Nokogiri, and stores results in a CSV with price-change tracking across runs. Learners practice HTML parsing with Nokogiri, HTTP requests, and simple data persistence for tracking changes over time.

Estimate
~7.5h
Steps
5
Completed by
0
Proposed by
codeseed.app

Nokogiri · HTTParty · CSV

Project roadmap

  1. 01

    Fetch and parse a listing page

    ~1.5h

    Use HTTParty to fetch a book listing page and Nokogiri to select title, price, and availability elements.

  2. 02

    Handle pagination

    ~1.5h

    Follow pagination links to scrape multiple pages of listings into a single result set.

  3. 03

    Store results with timestamps in CSV

    ~1.5h

    Append each scrape run's results to a CSV file including a timestamp column.

  4. 04

    Detect price changes across runs

    ~2h

    Compare the latest scrape to the previous one and print a report of books whose price changed.

  5. 05

    Add polite scraping behavior

    ~1h

    Add request delays and a user-agent header, and handle missing elements without crashing.

Resources

Ready to build this?

Get a GitHub repo and start building. Your AI reviewer checks each step as you go.

~7.5h · 5 steps

Tech stack

NokogiriHTTPartyCSV