Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/zetsuboii/html-parser

No-borrow HTML parser written in Rust
https://github.com/zetsuboii/html-parser

Last synced: about 2 months ago
JSON representation

No-borrow HTML parser written in Rust

Awesome Lists containing this project

README

        

# html-parser

Simple HTML parser that parses a HTML string and returns a list of tags and their
attributes without needing ownership over the string.

## Usage

```rust
use crate::HtmlParser;

let html = r#"

Test


Test


Test



"#;

let parsed = parse_html(html).unwrap();
let root = parsed[0];
assert_eq!(root.tag(), "html");
assert_eq!(root.children().len(), 2);
```