Browse the docs

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 #

ParameterTypeRequiredValuesWhat it does
urltextYesRequired.
asone oftext json htmltext, json or html.
bodyany value
browserone ofsafari chrome front
headersrecord
intotextThe variable that receives the result.
methodone ofGET POST PUT PATCH DELETE HEAD, headers, body: An object body is sent as JSON.
sampleany value
tabany value, browser, timeout.
timeoutnumber

Every step also accepts label, onFailure, timeout and dryRunSafe.

Examples #

Ask the site's own API
Do
  1. Fetch “/api/items” from the page
Open in Switchboard to try it

Gotchas #

  • The page's own rules apply: a site that blocks cross-origin requests answers only same-origin ones.

  • Use Send HTTP request with signIn for a site no browser has open.