get_web_header_json_value

Function get_web_header_json_value 

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

Parse a response string into the header JSON or its URL.

Strategy: first attempt to parse as JSON; if it fails, parse as HTML and extract the bmstable URL.

§Returns

  • HeaderQueryContent::Value: input is JSON;
  • HeaderQueryContent::Url: input is HTML.

§Errors

Returns an error when the input is HTML but the bmstable field cannot be found.