Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions src/content/docs/browser-rendering/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,19 @@ You can integrate Browser Rendering into your applications using the method that
- **[Playwright](/browser-rendering/playwright/)**: Modern browser automation with a developer-friendly API. The [MCP integration](/browser-rendering/playwright/playwright-mcp/) enables AI agents to autonomously browse and extract data.
- **[Stagehand](/browser-rendering/stagehand/)**: AI-native SDK using natural language selectors instead of brittle code selectors, ensuring workflows stay resilient when websites change.

### Choosing an integration method

| Use case | Recommended | Why |
| --- | --- | --- |
| Simple screenshot, PDF, or scrape | [REST API](/browser-rendering/rest-api/) | No code deployment needed; single HTTP request |
| Multi-step browser automation | [Puppeteer](/browser-rendering/puppeteer/) or [Playwright](/browser-rendering/playwright/) | Full control over navigation, clicks, and form fills |
| Porting existing automation scripts | [Puppeteer](/browser-rendering/puppeteer/) or [Playwright](/browser-rendering/playwright/) | Minimal code changes required from standard Puppeteer/Playwright |
| Modern automation with tracing | [Playwright](/browser-rendering/playwright/) | Built-in tracing, assertions, and better async handling |
| AI-powered data extraction | [REST API /json endpoint](/browser-rendering/rest-api/json-endpoint/) | Extract structured data using natural language prompts |
| AI agent browsing autonomously | [Playwright MCP](/browser-rendering/playwright/playwright-mcp/) | Enables LLMs to control browsers via Model Context Protocol |
| Resilient scraping (selectors break often) | [Stagehand](/browser-rendering/stagehand/) | Uses AI to find elements by intent, not brittle selectors |


## Related products

<RelatedProduct header="Workers" href="/workers/" product="workers">
Expand Down
2 changes: 1 addition & 1 deletion src/content/docs/browser-rendering/playwright/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Our version is open sourced and can be found in [Cloudflare's fork of Playwright
<PackageManagers pkg="@cloudflare/playwright" dev />

:::note
The current version of Playwright is [**v1.57.0**](https://github.com/cloudflare/playwright/releases/tag/v1.1.0).
The current version is [`@cloudflare/playwright` v1.1.0](https://github.com/cloudflare/playwright/releases/tag/v1.1.0), based on [Playwright v1.57.0](https://playwright.dev/docs/release-notes#version-157).
:::

## Use Playwright in a Worker
Expand Down
2 changes: 1 addition & 1 deletion src/content/docs/browser-rendering/puppeteer.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Our version is open sourced and can be found in [Cloudflare's fork of Puppeteer]
<PackageManagers pkg="@cloudflare/puppeteer" dev />

:::note
The current version of Puppeteer is [**v22.13.1**](https://github.com/cloudflare/puppeteer/releases/tag/v1.0.4).
The current version is [`@cloudflare/puppeteer` v1.0.4](https://github.com/cloudflare/puppeteer/releases/tag/v1.0.4), based on [Puppeteer v22.13.1](https://pptr.dev/chromium-support).
:::

## Use Puppeteer in a Worker
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ console.log(content);
If you have raw HTML you want to generate a PDF from, use the `html` option. You can still apply custom styles using the `addStyleTag` parameter.

```bash
curl -X POST https://api.cloudflare.com/client/v4/accounts/<acccountID>/browser-rendering/pdf \
curl -X POST https://api.cloudflare.com/client/v4/accounts/<accountId>/browser-rendering/pdf \
-H 'Authorization: Bearer <apiToken>' \
-H 'Content-Type: application/json' \
-d '{
Expand Down Expand Up @@ -131,7 +131,7 @@ curl -X POST 'https://api.cloudflare.com/client/v4/accounts/<accountId>/browser-
The options `rejectResourceTypes` and `rejectRequestPattern` can be used to block requests during rendering. The opposite can also be done, _only_ allow certain requests using `allowResourceTypes` and `allowRequestPattern`.

```bash
curl -X POST https://api.cloudflare.com/client/v4/accounts/<acccountID>/browser-rendering/pdf \
curl -X POST https://api.cloudflare.com/client/v4/accounts/<accountId>/browser-rendering/pdf \
-H 'Authorization: Bearer <apiToken>' \
-H 'Content-Type: application/json' \
-d '{
Expand Down
Loading