Skip to content

extract

Kelly Ferrone edited this page Sep 9, 2026 · 7 revisions

extract

Read an element's visible text and innerHTML.

MCP tool extract
HTTP POST /browser/extract

The primary way to read a page — prefer it over a screenshot, which costs far more. //body reads everything, but a narrower XPath keeps the result small.

Parameters

Name Type Required Default Notes
xpath string yes
session_id string yes over HTTP The session_id returned by /browser/open. Required here.
url string no
wait_timeout integer no 30

Returns

Field Type Notes
html string innerHTML of the matched element.
text string Visible text of the element.
url string Current URL after the action.
title string Page title after the action.

Errors are 400 for a bad argument, 401 without a token, 500 when the Grid refuses. Over MCP the same failures arrive as a tool error.

Example

MCP

extract(xpath="…")

HTTP

curl -X POST $SELENIUM_FLOW/browser/extract \
  -H "Authorization: Bearer $TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{
    "session_id": "…",
    "xpath": "…"
  }'

← All actions · Installing · Deployment

Clone this wiki locally