Skip to content

Commit 11db532

Browse files
authored
Update scrape-endpoint.mdx
- add subheadings - update to same style as pdf endpoint
1 parent 656eaee commit 11db532

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

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

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

1010
The `/scrape` endpoint extracts structured data from specific elements on a webpage, returning details such as element dimensions and inner HTML.
1111

12+
## Endpoint
13+
14+
```txt
15+
https://api.cloudflare.com/client/v4/accounts/<accountId>/browser-rendering/scrape
16+
```
17+
18+
## Required fields
19+
You must provide either `url` or `html`:
20+
- `url` (string)
21+
- `elements` (array of objects) — each object must include `selector` (string)
22+
23+
## Common use cases
24+
25+
- Extract headings, links, prices, or other repeated content with CSS selectors
26+
- Collect metadata (for example, titles, descriptions, canonical links)
27+
1228
## Basic usage
1329

30+
### Extract headings and links from a URL
31+
1432
<Tabs syncKey="workersExamples"> <TabItem label="curl">
1533

1634
Go to `https://example.com` and extract metadata from all `h1` and `a` elements in the DOM.

0 commit comments

Comments
 (0)