Actions

Pass an actions array on any scrape, extraction, crawl, or search request to drive the page before content is captured. Useful for logins, filters, pagination, and infinite-scroll sites.

Supported actions

  • click — click an element by CSS selector
  • type — fill an input with text
  • press — press a keyboard key (e.g. "Enter")
  • scroll — scroll by pixels in either direction
  • wait — wait for a selector or a fixed timeout
  • screenshot — capture a screenshot at this step
  • execute_js — run inline JavaScript in the page
  • extract — re-extract after actions complete

Example

actions-example.ts
await stack0.extraction.extractAndWait({
url: "https://example.com/search",
mode: "markdown",
actions: [
{ type: "type", selector: "input[name=q]", text: "playwright" },
{ type: "press", key: "Enter" },
{ type: "wait", selector: ".results", timeout: 5000 },
{ type: "scroll", direction: "down", pixels: 1200 },
{ type: "screenshot" },
],
});

Proxy & Stealth

Every scrape accepts stealth: true (default) and proxy: "residential" | "datacenter". Stealth runs the page through playwright-extra's evasion patches; proxy uses your configured provider via the WEBDATA_PROXY_SERVER environment variable.