Collect a lot more data.
This commit is contained in:
@@ -11,6 +11,13 @@ struct Info {
|
||||
message: String,
|
||||
}
|
||||
|
||||
#[derive(Debug, FromHtml)]
|
||||
#[html(selector = ".body-content > .row")]
|
||||
struct Error {
|
||||
#[html(selector = ".col-md-12", attr = "inner")]
|
||||
message: String,
|
||||
}
|
||||
|
||||
pub struct KonsumentInfo;
|
||||
|
||||
impl Probe for KonsumentInfo {
|
||||
@@ -33,9 +40,11 @@ impl Probe for KonsumentInfo {
|
||||
println!("konsumentinfo.se:");
|
||||
|
||||
if let Ok(info) = Info::from_html(&body) {
|
||||
println!(" {}", info.message);
|
||||
println!(" {}", info.message);
|
||||
} else if let Ok(error) = Error::from_html(&body) {
|
||||
println!(" {}", error.message);
|
||||
} else {
|
||||
println!(" Failed to find any data");
|
||||
println!(" Failed to find any data");
|
||||
}
|
||||
|
||||
Ok(())
|
||||
|
||||
Reference in New Issue
Block a user