Skip to main content

from_browser_page

Function from_browser_page 

Source
pub async fn from_browser_page(
    page: &Page,
    first_response: Option<&Response>,
    _final_response: Option<&Response>,
    meta: HashMap<String, Value>,
    _captured_xhr: Vec<XhrCapture>,
) -> Result<Response>
Expand description

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

This function extracts the rendered HTML via page.content() (retrying up to max_retries times), reads cookies from the browser context, parses the character encoding from the Content-Type header, and assembles everything into a scrapling_fetch::Response. The meta map and _captured_xhr list are passed through to the response for downstream consumers.