BrowserResource on client.browser gives you programmatic control over browser sessions in the Figranium Python SDK. You can open headless or headful sessions, inspect the current headful state, highlight candidate selectors on a page, and stream live selector events during an active headful session.
Methods
open
open
Opens a browser session. You can run in headless mode, headful mode, scrape mode, or agent mode.
- HTTP endpoint:
POST /api/browser/open - Signature:
open(input=None, *, options=None) - Returns:
BrowserSessionwithsessionId,status, and optionallywsEndpoint.
browser_open.py
highlight
highlight
Highlights candidate selectors on a page and returns a DOM snapshot. Useful for building or debugging selector-based tasks.
- HTTP endpoint:
POST /api/inspector/highlight - Signature:
highlight(input, *, options=None) - Returns: A dict with
success, a list ofSelectorCandidateobjects (css, optionalxpathandconfidence), and asnapshotstring.
browser_highlight.py
stop_headful
stop_headful
Stops the active headful browser session.
- HTTP endpoint:
POST /headful/stop - Signature:
stop_headful(*, options=None) - Returns: dict
browser_stop_headful.py
headful_status
headful_status
Checks whether the headful session is configured to use noVNC.
- HTTP endpoint:
GET /api/headful/status - Signature:
headful_status(*, options=None) - Returns:
{"useNovnc": bool}
browser_headful_status.py
inspect
inspect
Inspects the current headful session and returns diagnostic information.
- HTTP endpoint:
POST /api/headful/inspect - Signature:
inspect(*, options=None) - Returns: dict
browser_inspect.py
vnc_password
vnc_password
Retrieves the VNC password for the current headful session.
- HTTP endpoint:
GET /api/headful/vnc-password - Signature:
vnc_password(*, options=None) - Returns:
{"password": str}
browser_vnc_password.py
selector_stream
selector_stream
Streams live selector events from the headful session as an iterator.
- HTTP endpoint:
GET /api/headful/selector_stream - Signature:
selector_stream(*, options=None) - Returns:
Iterator[StreamEvent]onFigranium;AsyncIterator[StreamEvent]onAsyncFigranium
This is a server-sent event stream. For details on iterating streams and handling timeouts, see Streaming.
browser_selector_stream_sync.py
browser_selector_stream_async.py
Headful debugging workflow
A typical headful debugging session combines severalBrowserResource methods to open a browser, inspect state, stream selector events, and clean up when finished.
browser_workflow.py
Related resources
Streaming
Details on
Iterator[StreamEvent] and AsyncIterator[StreamEvent].Request options
Pass custom
headers and per-request timeout overrides.Errors
Handle
FigraniumError responses.Headful Browser
Learn about headful browser sessions in Figranium.
Highlight Tool
Use the highlight tool to build and debug selectors.