Skip to main content

Module response_factory

Module response_factory 

Source
Expand description

Factory for building scrapling_fetch::Response objects from Playwright pages.

After a browser session navigates to a URL and the page stabilises, this module extracts everything needed to construct a unified Response: the rendered HTML content, HTTP status code, response headers, cookies from the browser context, and the character encoding parsed from the Content-Type header.

The main entry point is from_browser_page, which is called internally by DynamicSession and StealthySession at the end of each fetch cycle. You generally do not need to call it directly.

The module also defines XhrCapture, a struct for holding intercepted XHR/fetch responses that were recorded during page navigation (when capture_xhr is set).

Structs§

XhrCapture
A captured XHR/fetch response recorded during page navigation.

Functions§

from_browser_page
Build a Response from a Playwright page and its navigation responses.