ahref

Crates.ioahref
lib.rsahref
version0.3.0
sourcesrc
created_at2023-09-05 18:47:03.49819
updated_at2024-01-08 19:07:53.36523
descriptionExtract 'a' tags from html page
homepage
repositoryhttps://github.com/tenqz/ahref
max_upload_size
id964719
size7,854
Oleg Patsay (tenqz)

documentation

https://docs.rs/ahref

README

Ahref

Extract "a" tags from html page

Installation

You can install Ahref using cargo:

cargo add ahref

Usage

Here's an example of how to use Ahref lib:

use ahref::Parser;

fn main() {
    let html = "<a href='https://github.com/tenqz'>Test link</a>".to_string();
    let mut parser = Parser::new(html);
    println!("{:?}", parser.parse_tags());
}

As a result, all "a" tags will be displayed.

["<a href='https://github.com/tenqz'>Test link</a>"]
use ahref::Parser;

fn main() {
    let html = "<a href='https://github.com/tenqz'>Test link</a>".to_string();
    let mut parser = Parser::new(html);
    println!("{:?}", parser.parse_links());
}

As a result, all urls will be displayed.

["https://github.com/tenqz"]
Commit count: 18

cargo fmt