Skip to content
Kelly Ferrone edited this page Sep 17, 2026 · 1 revision

print

Print the page into the session's files, kept past the browser.

MCP tool print
HTTP POST /browser/print

format="pdf" is the browser's own print: selectable text, the whole document. landscape turns the page and background keeps colours and images a print drops. format="html" is the page as it stands now, after its scripts ran.

To give it to a person, give them the file's absolute_url: it opens in any browser without a token. A server with no public address configured returns a relative url instead.

Parameters

Name Type Required Default
url string no
format string no pdf
filename string no
landscape boolean no false
background boolean no false

Every call names its session: an X-Session-Key header, or ?session=<name>. Sending both is refused. See Sessions.

Returns

Field Type Notes
file FileEntry
format string
bytes integer Size of the file in bytes.
url string Current URL after the action.
title string Page title after the action.

Errors

Status Means
400 The request cannot succeed as sent — a missing field, a value that was rejected, or a locator that matched nothing before the wait ran out. Do not retry it unchanged.
401 Missing or wrong bearer token.
404 No such browser session. It ended, the Grid reaped it, or the id was never real. Open a new one and retry.
500 Something failed that this server did not expect.
503 The Grid could not serve this — unreachable, or no free slot for a new browser. Worth retrying after a wait.

Over MCP the same failures arrive as a tool error.

Example

MCP

print()

HTTP

curl -X POST $SELENIUM_FLOW/browser/print \
  -H "Authorization: Bearer $TOKEN" \
  -H "X-Session-Key: $SESSION"

← All actions · Installing · Deployment

Clone this wiki locally