#fetch #title #extract #description #link #html #extact

extd

Fetch and extract HTML's title and description by given link

4 releases

0.1.4 Nov 3, 2022
0.1.2 Nov 2, 2022
0.1.1 Nov 2, 2022
0.1.0 Nov 2, 2022

#54 in #title

MIT license

4KB
58 lines

extd

Fetch and extract HTML's title and description by given link.

Usage

in Cargo.toml:

[dependencies]
extd = "0.1.2"

Example

use extd::extract_td;

fn main() {

    let res = extract_td("https://www.rustlang.org/");
    match res {
        Ok(res) => println!("{:?}", res),
        _ => println!("otherwise"),
    }
}

return value:

pub struct ExtractResult {
    // title
    pub title: String,
    // description
    pub desc: String,
}

Dependencies

~8–20MB
~305K SLoC