Price tracker with a polite scraper
beginner2 weeksPython
Track the price of a few products on a site that allows scraping and get a message when one drops.
Why build it
You learn HTTP, HTML parsing and scheduling, plus the habits that keep a scraper legal and polite: robots.txt, rate limits and caching.
Features
- Add a product URL and target price
- Fetch and parse the current price
- Store price history in SQLite
- Alert by email or Telegram when below target
- Price history chart
Roadmap
- p1
Choose a source
- Pick a site whose terms and robots.txt allow it
- Check for an official API first
- Save sample HTML for tests
- p2
Parse and store
- Fetch with requests and a custom User-Agent
- Parse the price with BeautifulSoup
- Insert into SQLite with a timestamp
- p3
Schedule and alert
- Run on a schedule with cron or GitHub Actions
- Send the alert
- Back off on errors
- p4
Show history
- Generate a chart with matplotlib
- Document how to add a new site parser
Common pitfalls
- Hammering a site with requests
- Parsing with brittle selectors and no tests against saved HTML
Skills you will practise
- HTTP
- HTML parsing
- SQLite
- Scheduling