/* Program: Bibliofile Purpose: This class is meant to process and return HTML formatted text as strings. Last edited: 6/28/23 */ use scraper::{Html, Selector}; pub fn main(content: String){ let str_content = Html::parse_document(&content); //Selector is HTML tag. Can be
or

or anything else. To parse entire page, set selector to let selector = Selector::parse("html").unwrap(); let unwrapped_page = str_content.select(&selector).next().unwrap(); let page = unwrapped_page.text().collect::>(); //every line in document is an entry into the vector. For loop iterates through every entry and displays it. for i in 0..page.len() { println!("{}", page[i]); } }