Some pages just have a number on them. A price, a stock count, a version string, a seat count, a shipping date. No RSS, no API, no email alert. The site gives you HTML and expects you to like it.

So you open the tab. Again. You scroll to the number, it hasn't moved, you close the tab. Tomorrow, same thing.

My last post was about feeding RSS and JSON into BriefBot, the little YAML-driven digest bot. The comment thread on it turned up one useful nudge: pricing pages are exactly the kind of thing worth watching.

Right. But pricing pages have no feed. That's what this post is about.

page_select, thirty lines, no mercy

BriefBot has a source type called page_select. It fetches a page, runs CSS selectors over the HTML, and stores whatever text those selectors match. The engine keeps the last snapshot in a state file and diffs it on every run. The whole source file is thirty lines of Python with BeautifulSoup. The core of it:

class PageSelectSource(Source): type = "page_select" def collect(self): url = self.spec["url"] resp = http_get(url) resp.raise_for_status() soup = BeautifulSoup(resp.text, "html.parser") fields = {} for name, selector in (self.spec.get("selectors") or {}).items(): node = soup.select_one(selector) fields[name] = node.get_text(strip=True) if node else "" ... 

You configure it and it watches. Nothing else to it.

To try it without breaking anything, I pointed it at a sandbox bookstore used for scraping practice and watched one product page: title, price, stock.

state: file: .state/state.json jobs: - name: price-watch subject: "Price watch {today}" sources: - type: page_select id: grand-design url: http://books.toscrape.com/catalogue/the-grand-design_405/index.html selectors: title: "h1" price: "p.price_color" stock: "p.instock.availability" digest: mode: plain # no LLM, no API key anywhere  watch_changes: true only_changed: true channels: - type: stdout # swap for telegram/email/feishu/... 

First real run:

Changes - [grand-design] (first snapshot): (none) -> title=The Grand Design, price=£13.76, stock=In stock (5 available) [price-watch] ok items=1 changes=1 stdout:ok 

Second run, minutes later, nothing changed:

[price-watch] skipped reason=no field changes 

That second line is the feature. only_changed: true means silence is the default. The bot speaks when the number moves, and only then. When the price changes, the brief carries the diff, old value and new value, one line.

The £ rendering as £ is real, by the way. That site serves UTF-8 without saying so, and the fetcher trusts the headers. The digits are what I care about. If your page does the same, now you know why.

Finding selectors without hating it

Open the page, right-click the number, Inspect. DevTools jumps to the element. Right-click the node in the tree, Copy, Copy selector. Paste it in.

Two habits worth ten minutes each:

  • Prefer short, semantic selectors (h1, p.price_color, #sku-price) over the auto-copied ones. The auto-copy gives you chains like div.col-sm-6 > div:nth-child(2) > p, which die the moment the site shuffles a div.
  • Watch at least two fields. A title alongside the price tells you instantly whether the page changed or your selector broke. stock in my example earns its place the same way.

If a selector matches nothing, the field comes back empty, and empty versus non-empty is itself a change, so a broken selector announces itself on the next run. There's also alert_after_failures, default 3: a source that fails three runs in a row raises a health warning into the brief instead of dying quietly.

What it will not do

No JavaScript. It parses the HTML the server sends. If your number is painted by a script after the page loads, page_select sees nothing. For that you want a headless-browser watcher, which is a different tool and a different resource bill.

It diffs text, not meaning. 1,234 to 1234 is a change. In stock (5 available) to In stock (4 available) is a change, which for stock counts is exactly what you want.

And be polite with cadence. A daily cron is fine. Checking every five minutes is the kind of thing that gets an IP blocked.

Running it free

Same path as the last post: the repo ships a GitHub Actions workflow, cron 0 0 * * *, which is 08:00 Beijing. It caches .state/ between runs. Running locally works too: the same run.py command from the README, plus whatever scheduler you already have. I use launchd on a Mac.

The comment thread on my first post flagged two Actions traps, both real: caches untouched for 7 days get evicted, and public repos get scheduled workflows paused after 60 days without activity. If state vanishes, the next run treats everything as fresh, and you get one noisy digest bounded by max_items, 30 by default. One digest, not a flood, then it re-baselines.

The usual trust block

The whole bot is 954 lines of Python, 4 dependencies, 37 tests, MIT. The page_select part is 30 of those lines. Read it before you trust it with your numbers. I would.

There's a one-time $19 launch kit for people who'd rather not set any of it up. The free path above is complete on its own.

What's the one page you'd point this at? The weirder the better. Plan tables that barely move came up in that last thread, and honestly that's the correct amount of patience for this tool.