capabilities.work

Function Then Download

A 2-step recipe with Browserless. We can help you get access.

Recipe · 2 steps

Function Then Download

Prepare a page with a custom function, then trigger and retrieve a download.

  1. Run the setup JavaScript against a Browserless session to navigate to and prepare the page that will emit the download.
  2. Run the download JavaScript, which triggers the file download. The response carries the captured downloaded artifacts.
What you'll need to have ready
  • token: The Browserless authorization token passed as a query parameter.
  • setupCode: JavaScript to prepare or navigate the page before downloading.
  • downloadCode: JavaScript that triggers the file download to be captured.
  • context: Optional context values passed into the executed functions.
For your developer

Arazzo workflow browserless:function-download, 2 operations: {$sourceDescriptions.browserRestApisApi.url}#/paths/~1chrome~1function/post → {$sourceDescriptions.browserRestApisApi.url}#/paths/~1chrome~1download/post. Specs on APIs.io.