File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed
src/content/docs/browser-rendering/rest-api Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -27,7 +27,7 @@ curl -X POST 'https://api.cloudflare.com/client/v4/accounts/<accountId>/browser-
2727 {
2828 "selector": "a"
2929 }]
30- }'
30+ }
3131```
3232
3333```json output
@@ -74,13 +74,15 @@ curl -X POST 'https://api.cloudflare.com/client/v4/accounts/<accountId>/browser-
7474import Cloudflare from "cloudflare";
7575
7676const client = new Cloudflare({
77- apiEmail: process .env [" CLOUDFLARE_EMAIL" ], // This is the default and can be omitted
78- apiKey: process .env [" CLOUDFLARE_API_KEY" ], // This is the default and can be omitted
77+ apiToken: process.env["CLOUDFLARE_API_TOKEN"],
7978});
8079
8180const scrapes = await client.browserRendering.scrape.create({
82- account_id: " account_id" ,
83- elements: [{ selector: " selector" }],
81+ account_id: process.env["CLOUDFLARE_ACCOUNT_ID"],
82+ elements: [
83+ { selector: "h1" },
84+ { selector: "a" }
85+ ]
8486});
8587
8688console.log(scrapes);
You can’t perform that action at this time.
0 commit comments