Skip to main content
Every morning someone on an operations team signs in to the warehouse portal, opens the list of shipments with exceptions, and chases each one through a message thread and a carrier’s tracking page. The first half is the same clicks every day. The second half is different every time: UPS, FedEx and a regional freight carrier each lay out tracking their own way. This program scripts the first half with Playwright and gives the second half to an agent, one shipment at a time. This example is TypeScript only: oc.browser(), the browser you drive with Playwright, exists only in the TypeScript SDK.

What you need

  • An Outcrawl API key in OUTCRAWL_API_KEY.
  • The portal’s sign-in in NORTHGATE_EMAIL and NORTHGATE_PASSWORD. The script types them itself; the agent never sees them.
  • npm install @outcrawl/sdk playwright. Playwright is only the driver; the browser runs on Outcrawl.

How it works

1

Open a browser in a profile

oc.browser({ profile }) opens a browser in a profile, so the portal’s login is kept after the first run and the script skips the sign-in from then on.
2

Script the part that never changes

Sign in with the SDK’s human-input methods, then read the exceptions table row by row with Playwright through page.raw. The list is read exactly, not interpreted by a model.
3

Close the browser and pass the profile on

An agent run cannot attach to a browser you opened. What it can share is the profile: closing the browser frees your browser slot and the profile, and the agent run starts signed in to the same account.
4

Give each exception to an agent

Each agent run reads one shipment’s thread, follows its carrier’s tracking page wherever it leads, and answers in a schema. A per-run rule forbids messages, claims and changes to a shipment.

The program

The browser closes in finally, whatever happens in between. A browser that is never closed keeps holding one of your account’s browser slots until its lease runs out, six hours later. The agent runs go one after another because a profile holds one session at a time.

What you get back

console.table(report) prints one row per exception (a sample):

What it costs

A browser you drive yourself is 1 credit a minute, plus proxy usage. The scripted part takes about 45 seconds: under 1 credit. An agent run is billed for the model’s usage, browser time and proxy usage, and a typical run costs about 15 credits a minute all in, proxy usage included. A shipment takes about 50 seconds (the shipment, the carrier’s tracking page, one detail view): about 13 credits per exception, with a caps.budget of 25 for each run. That is an estimate: the real figure depends on the task, and a heavy tracking page costs more. Twelve exceptions a morning is about 157 credits, or about 3,450 over 22 working days. Reading the table with an agent as well would add about 30 seconds, 8 credits a day, and the list would come from a model instead of from the page.

Make it yours

  • Run the script from a scheduler at 07:00 and post the table to your team’s channel with a Slack incoming webhook.
  • Filter in the script: send only exceptions older than a day to an agent.
  • Use page.extract(instruction, schema) inside the scripted session for a one-off read that is not worth a whole agent run.
  • When the portal changes its sign-in form, only the four sign-in lines change; the agents do not care.

Browsers

oc.browser(), page.raw and human input.

Profiles

The login the script and the agents share.

Agents

Schemas, caps and statuses.

Rules

Guardrails for each run.