Make a request from the page
Sends a request from inside a tab, with that site's cookies, so its own JSON API answers as it does for the site.
Fetch url from the page
Details #
The request is made by the page, from its origin and with its cookies, so a site's own JSON API answers as it does for the site. There is no HTML to parse, which makes this the cleanest way to scrape. url may be relative to the page. The result is {status, ok, url, headers, body, json}; as: json fails the step when the reply isn't JSON.
Parameters #
| Parameter | Type | Required | Values | What it does |
|---|---|---|---|---|
url | text | Yes | Required. | |
as | one of | text json html | text, json or html. | |
body | any value | |||
browser | one of | safari chrome front | ||
headers | record | |||
into | text | The variable that receives the result. | ||
method | one of | GET POST PUT PATCH DELETE HEAD | , headers, body: An object body is sent as JSON. | |
sample | any value | |||
tab | any value | , browser, timeout. | ||
timeout | number |
Every step also accepts label, onFailure, timeout and dryRunSafe.
Examples #
Ask the site's own API
Do
- Fetch “/api/items” from the page
Gotchas #
The page's own rules apply: a site that blocks cross-origin requests answers only same-origin ones.
Use Send HTTP request with
signInfor a site no browser has open.