> ## 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.

# Extract links

> Render a page and return its links.

`cloudflare.extractLinks` renders a page and returns links discovered in it.

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

export default automation("List documentation links", () => {
  onDashboardRun({ title: "List documentation links" })
  const links = cloudflare.extractLinks({
    accountId: "cloudflare-account-id",
    excludeExternalLinks: true,
    url: "https://example.com/docs",
    visibleLinksOnly: true,
  })
  sendEmail({ subject: "Documentation links", text: JSON.stringify(links) })
})
```

## Inputs

Provide `accountId` and exactly one of `url` or `html`. `excludeExternalLinks` keeps links on the rendered origin; `visibleLinksOnly` excludes hidden links. `cacheTtl` defaults to 5 seconds. The common Browser Run timeout, request, authentication, page-setup, viewport, navigation, and wait controls are also available.

## Output

Returns an array of link strings. The action consumes Browser Run duration and is not replay-safe.
