Crates.io | tagparser |
lib.rs | tagparser |
version | 0.2.0 |
source | src |
created_at | 2024-01-06 15:45:10.413778 |
updated_at | 2024-01-06 16:02:00.657465 |
description | Extract any tags from html page |
homepage | |
repository | https://github.com/tenqz/tagparser |
max_upload_size | |
id | 1091005 |
size | 5,662 |
You can install Ahref using cargo:
cargo add tagparser
Here's an example of how to use Tagparser lib:
use tagparser::Parser;
fn main() {
let html = "<a href='https://github.com/tenqz'>Test link</a><p>test p tag</p>".to_string();
let mut parser = Parser::new(html);
println!("{:?}", parser.parse_tags("a".to_string()));
println!("{:?}", parser.parse_tags("p".to_string()));
}
As a result, all "a" and "p" tags will be displayed.
["<a href='https://github.com/tenqz'>Test link</a>"]
["<p>test p tag</p>"]