Project file N°08

Supplier Portal Bot — B2B Price & Stock Sync

A Python and Playwright bot that logs into a supplier's B2B portal, searches thousands of SKUs one by one, reads price and per-warehouse stock, and writes the result back as an import-ready Excel file for the store.

Stack

  • Python
  • Playwright
  • openpyxl
  • Matrixify
  • Shopify

The problem

The supplier has no API. Prices and warehouse stock for a few thousand SKUs only exist behind a login, one search at a time, and the store's catalogue drifted out of date between manual checks.

What we built

  1. 01Headless browser session with a persistent profile, so the bot reuses its login instead of signing in on every run
  2. 02Two-factor email verification handled once in visible mode, then trusted for later runs
  3. 03Session-loss detection that re-logs in automatically instead of recording a false 'not found'
  4. 04SKU repair: when an older script had replaced dashes with zeros, the bot scores each zero and tries the most likely original SKUs first
  5. 05Warehouse names on the portal mapped to the store's inventory locations, with stock values cleaned (ranges, '>5000', missing values)
  6. 06Results cached so a stopped run resumes where it left off, with a separate tool to inspect and remove bad cache entries

Outcome

  • —One Excel file with an import sheet ready for Matrixify, plus sheets for price increases, decreases, large deviations and SKUs not found
  • —Price and stock checks no longer have to be done by hand, SKU by SKU

Next project →

Character Browser — Next.js + NestJS GraphQL →