Available on crate feature
scraper only.Expand description
Data fetching and HTML parsing helpers
Provides HTML parsing when the scraper feature is enabled, used to extract the header JSON URL from
<meta name="bmstable" content="..."> in a page.
Also provides a unified entry to parse a response string into the header JSON or its URL.
§Examples
let html = r#"
<!DOCTYPE html>
<html>
<head>
<meta name="bmstable" content="header.json">
</head>
<body></body>
</html>
"#;
match get_web_header_json_value::<serde_json::Value>(html).unwrap() {
HeaderQueryContent::Url(u) => assert_eq!(u, "header.json"),
_ => unreachable!(),
}Modules§
- reqwest
reqwest - Network fetching module based on
reqwest
Enums§
- Header
Query Content - Return type of
get_web_header_json_value.
Functions§
- extract_
bmstable_ url - Extract the JSON file URL pointed to by the bmstable field from HTML page content.
- get_
web_ header_ json_ value - Parse a response string into the header JSON or its URL.