header_query_with_fallback

Function header_query_with_fallback 

Source
pub fn header_query_with_fallback<T: DeserializeOwned>(
    raw: &str,
) -> Result<(HeaderQueryContent<T>, String)>
Available on crate feature scraper only.
Expand description

Extract the header query content from a response string with a fallback cleaning step.

Attempts get_web_header_json_value on raw first; on failure, retries with a control-character-cleaned string via replace_control_chars. Returns the content and the raw string actually used for the successful extraction.

ยงErrors

Returns an error when both attempts fail to extract a header URL or parse JSON.