The page navigation methods for going to a URL, reloading, going back, and going forward return the final main-document response when navigation performs a network request. Redirects return the final response in the chain.
The nullable result is not an error. Navigations to URLs such as data: and about:, same-document navigations, and history operations with no matching entry can complete without a network response.
Stagehand retrieves response bodies and complete metadata lazily. Use the response while its Stagehand session is open. Response handles become invalid when the session closes, and the runtime may collect older handles after enough newer responses arrive.
Navigation
The navigation signatures are:Navigation now returns Response | null, rather than returning the Page. The page’s internal reference and page.url() are still updated before the method resolves. If you do not need the response, continue to ignore the return value:These methods read metadata included with the navigation result and do not make another RPC call:ok() is true for status codes from 200 through 299. headers() returns normalized headers with lowercase names and returns a new object on every call.Header lookup is case-insensitive. headerValue() joins duplicate values with , , while headerValues() keeps them separate. headersArray() preserves order, casing, and duplicates. allHeaders() includes extra-info headers, such as set-cookie, when Chrome provides them.Body and completion
Body access is lazy. Each SDK call requests the body through the response handle; Stagehand reuses the underlying browser body retrieval. json() preserves JSON parse errors. finished() resolves to null after success or an Error describing the loading failure.Navigation
The navigation return types are:Navigation now returns Response | None, rather than returning the Page. The page’s internal reference and await page.url() are still updated before the method returns. If you do not need the response, continue to ignore the return value:These properties read metadata included with the navigation result and do not make another RPC call:ok is True for status codes from 200 through 299. headers contains normalized lowercase names and returns a new dictionary on every access.Header lookup is case-insensitive. header_value() joins duplicate values with , , while header_values() keeps them separate. headers_array() preserves order, casing, and duplicates. all_headers() includes extra-info headers, such as set-cookie, when Chrome provides them.Body and completion
Body access is lazy. Each SDK call requests the body through the response handle; Stagehand reuses the underlying browser body retrieval. UTF-8 decoding and JSON parsing preserve their native errors. finished() returns None after success or an exception describing the loading failure.Navigation
The navigation signatures are:Navigation now returns (*Response, error), rather than only error. The page reference is updated before a successful method returns. A successful navigation without a network response returns (nil, nil). Ignore the response with _ when you only need navigation:These methods read metadata included with the navigation result and do not make another RPC call:OK() is true for status codes from 200 through 299. Headers() returns normalized headers with lowercase names and returns a new map on every call.Header lookup is case-insensitive. HeaderValue() distinguishes a missing header from a present empty value with present, and joins duplicate values with , . HeaderValues() keeps duplicates separate. HeadersArray() preserves order, casing, and duplicates. AllHeaders() includes extra-info headers, such as set-cookie, when Chrome provides them.Body and completion
Body access is lazy. Each SDK call requests the body through the response handle; Stagehand reuses the underlying browser body retrieval. JSON() decodes into the supplied destination. Finished() returns the loading failure or an RPC error, and returns nil after success.