readability-rs is a library for extracting the primary readable content of a webpage. This is a rust port of arc90's readability project. inspired by kingwkb/readability.
- Add
readabilityto dependencies in Cargo.toml
[dependencies]
readability = "^0"- Then, use it as below
externcrate readability;use readability::extractor;fnmain(){match extractor::scrape("https://spincoaster.com/chromeo-juice"){Ok(product) => {println!("------- html ------");println!("{}", product.content);println!("---- plain text ---");println!("{}", product.text);},Err(_) => println!("error occured"),}}Visit demo page.