Skip to main content

Browser Automation

Type ID: core.browserAutomation  ·  Kind: Action  ·  Trace: TOOL

Launches a Chromium browser with Playwright, optionally performs a form login (with TOTP support), then runs an ordered list of steps — navigate, fill, click, wait, and extract — returning the collected data.

Credentials

None

Properties

PropertyKeyTypeRequiredDefaultPossible valuesShown when
URLurlstringYes''Start URL (or metrics URL)Always
Timeout (ms)timeoutMsnumberNo30000Default page timeout in millisecondsAlways
Include HTMLincludeHtmlbooleanNofalseInclude page HTML in output (can be large)Always
Auth Typeauth.typeoptionsNononenone — None; form — Form LoginAlways
Login URLauth.loginUrlstringNo''URL of the login pageauth.type = form
Username Selectorauth.usernameSelectorstringNo#emailCSS selector for the username fieldauth.type = form
Password Selectorauth.passwordSelectorstringNo#passwordCSS selector for the password fieldauth.type = form
Submit Selectorauth.submitSelectorstringNobutton[type=submit]CSS selector for the submit buttonauth.type = form
OTP Selector (optional)auth.otpSelectorstringNo''Selector for the OTP input, if the site asks for oneauth.type = form
OTP Submit Selector (optional)auth.otpSubmitSelectorstringNo''Selector to submit the OTPauth.type = form
Use TOTP (Authenticator) Automaticallyauth.useTotpbooleanNofalseGenerate the OTP from a TOTP secret in credentialsauth.type = form
StepsstepsarrayNo[]Ordered automation steps (see below)Always

Steps (nested fields)

Each array entry is a step object with a type and type-specific fields.

FieldKeyTypeDefaultPossible valuesShown when
Typetypeoptionsgotogoto — Go To; fill — Fill; click — Click; waitForSelector — Wait For Selector; waitForTimeout — Wait For Timeout; extract — ExtractAlways
URLurlstring''Target URLtype = goto
Wait UntilwaitUntiloptionsnetworkidleload — Load; domcontentloaded — DOM Loaded; networkidle — Network Idletype = goto
Selectorselectorstring''CSS selectortype = fill, click, waitForSelector
Valuevaluestring''Value to filltype = fill
Timeout (ms)timeoutMsnumber15000Wait timeout in millisecondstype = waitForSelector, waitForTimeout
Selectorsselectorsarray[]Extraction rules (see below)type = extract

Extract selectors (nested rule fields)

Each entry is a selectorRule object:

FieldKeyTypeDefaultPossible valuesShown when
KeykeystringmetricOutput key for the extracted valueAlways
CSS Selectorselectorstring[data-testid=metric]CSS selector to read fromAlways
Typetypeoptionstexttext — Text; texts — Texts; attr — Attribute; attrs — AttributesAlways
Attribute NameattrNamestringhrefAttribute to readtype = attr, attrs

Notes

  • Parameters are resolved through the resolver engine before execution.
  • The browser is launched with chromium.launch({ headless: false }) — a non-headless Chromium — using a fresh newContext/newPage. The page's default timeout is set from timeoutMs.
  • Form login (auth.type = form) navigates to loginUrl (networkidle), fills username and password, clicks submit. If otpSelector is set it waits up to 8000 ms for it; on timeout it returns silently. When the OTP field appears and useTotp is true, a 6-digit TOTP is generated from auth.totpSecret (via otplib), filled in, optionally submitted via otpSubmitSelector, then waits for networkidle. If the OTP field is present but useTotp is false, it throws OTP required but useTotp is disabled.; if useTotp is true without a secret it throws.
  • Steps run in array order: goto navigates to step.url (falling back to the top-level url) with the chosen waitUntil; fill and click act on the selector; waitForSelector waits for the element; waitForTimeout sleeps. extract reads each rule — text → first element's textContent, texts → all text contents, attr → first element's attribute, attrs → that attribute across all matches — into the extracted map under rule.key.
  • After each step, if includeHtml is true the current page.content() is captured as lastHtml.
  • Output is a single item { url, finalUrl, title, extracted, html?, timings: { totalMs } }. Errors are caught and returned as { error: true, message, timings } (not thrown). The page and browser are always closed in finally.