Skip to content

Commit 2dc2936

Browse files
authored
Update content-endpoint.mdx
- add subheadings - update to same style as pdf endpoint
1 parent dfb78df commit 2dc2936

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

src/content/docs/browser-rendering/rest-api/content-endpoint.mdx

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,26 @@ import { Tabs, TabItem, Render } from "~/components";
99

1010
The `/content` endpoint instructs the browser to navigate to a website and capture the fully rendered HTML of a page, including the `head` section, after JavaScript execution. This is ideal for capturing content from JavaScript-heavy or interactive websites.
1111

12+
## Endpoint
13+
14+
```txt
15+
https://api.cloudflare.com/client/v4/accounts/<accountId>/browser-rendering/content
16+
```
17+
18+
## Required fields
19+
You must provide either `url` or `html`:
20+
- `url` (string)
21+
- `html` (string)
22+
23+
## Common use cases
24+
25+
- Capture the fully rendered HTML of a dynamic page
26+
- Extract HTML for parsing, scraping, or downstream processing
27+
1228
## Basic usage
1329

30+
### Fetch rendered HTML from a URL
31+
1432
<Tabs syncKey="workersExamples"> <TabItem label="curl">
1533

1634
Go to `https://developers.cloudflare.com/` and return the rendered HTML.
@@ -43,6 +61,8 @@ console.log(content);
4361

4462
## Advanced usage
4563

64+
### Block specific resource types
65+
4666
Navigate to `https://cloudflare.com/` but block images and stylesheets from loading. Undesired requests can be blocked by resource type (`rejectResourceTypes`) or by using a regex pattern (`rejectRequestPattern`). The opposite can also be done, only allow requests that match `allowRequestPattern` or `allowResourceTypes`.
4767

4868
```bash

0 commit comments

Comments
 (0)