DEV Community

Macadamia
Macadamia

Posted on

I automated price & stock checks with a small Python tool — here's the practical setup

If you sell or source products online, you probably do this by hand: open the same pages every day, check whether the price changed or the item is back in stock, write it down somewhere. It is simple work, but it eats time and it is easy to miss a change.

I built a small Python tool that does this routine on a schedule. This post walks through the design decisions that made it reliable enough to deliver to clients — not the code line by line, but the parts people usually get wrong.

What the tool does

  1. Reads a list of target pages from a settings file
  2. Visits each page politely (respecting robots.txt and the site's terms, with sane intervals)
  3. Extracts the price / stock status and compares it with the previous run
  4. Records every check in a log, and sends a notification (e.g. Discord) only when something changed

The "notify only on change" part matters. A tool that pings you every hour trains you to ignore it within a week.

Three design decisions

Keep a history, not just the latest value. Storing every observation with a timestamp turns a checker into evidence: you can see when a price moved, and by how much. Storage is cheap (SQLite is enough); regret is not.

Separate "couldn't check" from "no change". A blocked page or a layout change is not the same as "price unchanged". The tool logs failures explicitly instead of silently treating them as no-change. Silent failures are how automations lie to you.

Make targets configuration, not code. URLs, thresholds and notification switches live in a settings file, so the same tool covers a price watch, a stock watch, or a page-update watch without edits.

Etiquette is a feature

Public pages only, no logins, no CAPTCHA bypassing, no personal data. If a site says no in robots.txt, the answer is no. This is not just politeness — a tool that gets your IP blocked is a broken tool.

Samples

I keep runnable samples in my Upwork catalog, including a change-detection demo and the notification format, so you can judge the output before ordering anything:
https://www.upwork.com/freelancers/~0183d607ae2ca19be7

Disclosure: I use AI tools in my workflow; every deliverable is personally inspected and tested by me before delivery.

Top comments (0)