> ## Documentation Index
> Fetch the complete documentation index at: https://docs.automate.ax/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> Automate.ax automations are TypeScript programs.
> Use Bun for installation and command examples.
> Use Automate.ax for the product name and automate.ax for the package, CLI, and domain.
> Treat documented public APIs as current; do not invent transitional or deprecated names.

# Scrape elements

> Render a page and extract elements that match CSS selectors.

`cloudflare.scrapeElements` extracts rendered element content and geometry for CSS selectors.

```ts automations/scrape-cloudflare-elements.automation.ts theme={null}
import { automation, onDashboardRun, sendEmail } from "automate.ax"
import { cloudflare } from "automate.ax/cloudflare"

export default automation("Scrape product price", () => {
  onDashboardRun({ title: "Scrape product price" })
  const elements = cloudflare.scrapeElements({
    accountId: "cloudflare-account-id",
    elements: [{ selector: "[data-product-price]" }],
    url: "https://example.com/products/1",
  })
  sendEmail({ subject: "Product price", text: JSON.stringify(elements) })
})
```

## Inputs

Provide `accountId`, one or more `elements` with a non-empty CSS `selector`, and exactly one of `url` or `html`. `cacheTtl` defaults to 5 seconds. The common Browser Run timeout, request, authentication, page-setup, viewport, navigation, and wait controls are also available.

## Output

Returns one entry per selector. Each entry contains a `results` array with every matched element's text, HTML, attributes, position, width, and height. The action consumes Browser Run duration and is not replay-safe.
