Eyal Rosenthal · Web scraping at scale

BigCommerce Store Monitor

BigCommerce Store Monitor — Twice-Daily Inventory Crawl with Email Change Reports

BigCommerce Store Inventory Monitor

Production-grade Python monitor that crawls a BigCommerce storefront's category pages, detects inventory changes (new/removed products, price drops, stock changes), and emails a structured change report. Designed for unattended VPS execution behind a cron schedule.

Built on 2026-05-03 to match an active Upwork brief (Job ID ~022050661...):

"I need a Python script that monitors a single BigCommerce storefront (~40 category pages, ~4,000 product listings) for inventory changes... twice daily... change report... email automatically."

Features

  • 🛒 Crawls all category URLs from config.json (paginated)
  • 🎯 Extracts name, price, URL, in-stock per product (selector fallback chain → robust to theme variants)
  • 🔁 Snapshots state per-category in JSON; idempotent re-runs
  • 🪞 Diffs against last snapshot: added / removed / price-changed / stock-changed
  • ✉️ Sends a formatted email + CSV attachment via SMTP (or print-mode for testing)
  • 🪞 Tenacity-driven retry on transient HTTP failures (3 attempts, exponential backoff)
  • 📜 Append-only audit log (monitor.log) per run
  • ⏱ 1-second politeness sleep between categories (respects target servers)
  • 🐢 Cron-friendly (single-shot exit; no background processes)

Run

# Setup
cd ~/freelance/portfolio_demos/bigcommerce_monitor
. ~/freelance/.venv/bin/activate
pip install requests beautifulsoup4 tenacity python-dotenv

# Optional: configure SMTP for live email
cp .env.example .env  # then edit SMTP_HOST/USER/PASS/REPORT_TO
# Single crawl, print report (good for testing)
python monitor.py --once

# Live: crawl + email
python monitor.py --run

# Demo: simulate competitor price changes after a baseline
python monitor.py --reset
python monitor.py --once                  # baseline
python monitor.py --simulate-changes 5    # tweak state
python monitor.py --once                  # see the diff fire

Acceptance test (last verified run)

  • Baseline crawl: 72 products across 5 categories of cornerstone-light-demo.mybigcommerce.com
  • Re-run on identical site: 0 changes detected (idempotent) ✅
  • Simulated 5 price changes via --simulate-changes 5
  • Re-run: 5 price changes detected + email body rendered + CSV emitted ✅

Production deployment (VPS, 5 min)

# On a $5/mo VPS:
git clone <repo>
cd bigcommerce_monitor
python3 -m venv .venv && source .venv/bin/activate
pip install -r requirements.txt
cp .env.example .env  # edit SMTP creds
crontab -e
# Add:
# 0 6,18 * * * cd /opt/bigcommerce_monitor && .venv/bin/python monitor.py --run >> /var/log/bcmon.log 2>&1

That's it — twice-daily reports forever.

Why this beats no-code tools

  • Octoparse / Browse AI: break silently when BigCommerce themes redesign. This script's selector fallback chain + last-resort regex on price = layout-resilient.
  • Per-credit pricing tools (ScrapingBee): 4,000 products × 2 runs/day × 30 days = 240,000 credit-equivalents/month. ScrapingBee at 5 credits/JS-render = $1,200+/mo. This script: $5/mo VPS.
  • Custom in-house dev: usually 2-3 days. This delivers a maintainable, idempotent, alert-ready system in a few hours.

Files

  • monitor.py — main script
  • config.json — store name + category URL list + cron schedule
  • state/ — per-category JSON snapshots (gitignored)
  • reports/ — CSV reports per run (gitignored)
  • monitor.log — audit log
  • .env.example — SMTP config template

Hire me to build this for your stack

Same patterns, your target site. Send the brief and I'll quote fixed-price within 24 hours.

info@luba.media