HTML parser written in pure Rust,no-std

Crates.io Rust license [dependencies] loa = "0.1.5"

get node attributes

```rust

[allow(warnings)]

fn main() { use loa::{getelementsbytagname, getfirstelementbytagname, Getattribute}; let html = includestr!("../index.html"); let plist: Vec = loa::getelementsbytagname(html, "p"); let afirst: String = loa::getfirstelementbytagname(html, "a").unwrap(); let href = afirst.getattribute("href"); println!("{:?}", plist); println!("{:?}", afirst); println!("{:?}", href); let buttons = getelementsbytagname(html, "button"); for bu in &buttons{ if bu.contains("Cargo.toml"){ println!("{:?}",bu.getattribute("title")); } } }
## parse html get Vec of nodes rust #[allow(warnings)] fn main() { use loa::{getelementsbytagname, getfirstelementbytagname, Getattribute}; let html = includestr!("../index.html"); let plist: Vec = loa::getelementsbytagname(html, "p"); let afirst: String = loa::getfirstelementbytagname(html, "a").unwrap(); let href = afirst.getattribute("href"); let class = afirst.getattribute("class"); println!("{:?}", plist); println!("{:?}", afirst); println!("{:?}", href); println!("{:?}", class); }
## parse html and get first element by tag name rust #[allow(warnings)] fn main() { use loa::{get
elementsbytagname, getfirstelementbytagname, Getattribute}; let html = includestr!("../index.html"); let plist: Vec = loa::getelementsbytagname(html, "p"); let afirst: String = loa::getfirstelementbytagname(html, "a").unwrap(); let href = afirst.getattribute("href"); let class = afirst.getattribute("class"); println!("{:?}", plist); println!("{:?}", afirst); println!("{:?}", href); println!("{:?}", class); }
```

get all nods by class name

```rust

[allow(warnings)]

fn main() { use loa::{ getelementsbyclassname, getelementsbytagname, getfirstelementbytagname, Getattribute, }; let html = includestr!("../index.html"); let allclass = getelementsbyclassname(html, "cake"); println!("{:#?}",allclass); } ## get all a tags href rust #[allow(warnings)] fn main(){ use loa::*; let html = includestr!("../index.html"); let hrefs = getallahrefs(html); println!("{:#?}",hrefs.unwrap()); } ```

get first element by class name

rust #[allow(warnings)] fn main() { use loa::{ get_elements_by_class_name, get_elements_by_tag_name, get_first_element_by_tag_name, get_first_element_by_class_name, Getattribute, }; let html = include_str!("../index.html"); let class = get_first_element_by_class_name(html, "cake"); println!("{:#?}",class); }