Automation · Tooling

Browser Automation Pipeline

Retail operations workflow automation for Plato's Closet

PythonAutomationGoogle Sheets APIPlaywright

Overview

Built a browser automation and Google Sheets integration pipeline for Plato’s Closet (US retail), replacing a set of repetitive manual workflows that store staff performed daily.

The Problem

Store staff were spending significant time on a daily workflow that involved navigating a web-based inventory system, extracting data, reformatting it, and pasting it into Google Sheets for reporting. The process was error-prone, slow, and a poor use of staff time.

The Solution

A Python script using Playwright for browser automation drove the inventory system headlessly, scraped the relevant data, transformed it into the required structure, and wrote it directly to the Google Sheets document via the Sheets API — all without human interaction.

async def run_daily_export(config: Config) -> None:
    async with async_playwright() as p:
        browser = await p.chromium.launch(headless=True)
        page = await browser.new_page()

        await login(page, config.credentials)
        rows = await extract_inventory(page, config.date_range)
        await browser.close()

    sheet = build_sheets_client(config.service_account)
    await write_rows(sheet, config.spreadsheet_id, rows)

Robustness

Retail inventory systems are not designed for automation — they change without notice, have session timeouts, and occasionally serve degraded HTML. The pipeline was built with:

  • Retry logic on transient failures with exponential backoff
  • Screenshot capture on unexpected states for debugging
  • Slack notification on failure so staff could intervene if needed
  • Idempotent writes to Sheets so re-runs don’t produce duplicate rows

Outcome

The daily workflow went from 45–60 minutes of manual work to a scheduled script that completed in under 3 minutes with no human involvement required.

Technical Stack

Python · Playwright · Google Sheets API · Google Service Accounts · Docker