Expand description
Crawl a website into a portable directed hyperlink graph.
use ahref::{crawl, CrawlOptions, export::{self, Format}};
let graph = crawl("https://example.com", CrawlOptions {
max_pages: 100,
concurrency: 3,
..Default::default()
}).await?;
export::write(&graph, Format::Json, std::io::stdout())?;Offline analysis is available through Graph::analyze. HTTP failures become node
outcomes; invalid options, invalid graph input and output failures return Error.
Re-exports§
pub use crawler::crawl;pub use crawler::CrawlOptions;pub use error::Error;pub use error::Result;pub use graph::Graph;pub use graph::LinkEdge;pub use graph::LinkType;pub use graph::PageNode;pub use parser::Parser;
Modules§
Functions§
- get_
a_ tags - Compatibility helper. HTML is serialized by the HTML5 parser.
- get_
url_ from_ tags - Compatibility helper returning raw href attributes in document order.