Module html

Module html 

Source
Expand description

Parse HTML documents into HtmlDocuments.

§Example: parse HTML text into a document

use skyscraper::html::{self, parse::ParseError};
let html_text = r##"
<html>
    <body>
        <div>Hello world</div>
    </body>
</html>"##;

let document = html::parse(html_text)?;

Re-exports§

pub use crate::html::parse::parse;

Modules§

parse
Create HtmlDocuments from textual input.

Structs§

DocumentNode
A key representing a single HtmlNode contained in a HtmlDocument.
HtmlDocument
HTML document tree represented by an indextree arena and a root node.
HtmlTag
An HTML tag and its attributes.
HtmlText
Text content in an HTML document.

Enums§

DocumentFormatType
Describes the formatting when converting an HtmlDocument to a string.
HtmlNode
An HTML node can be either a tag or raw text.

Functions§

escape_characters
Escapes commonly escaped characters in HTML text.
trim_internal_whitespace
Trims internal whitespace from the given text such that only a single space separates words. This is used to emulate the behaviour of Chromium browsers.
unescape_characters
Unescapes commonly escaped characters in HTML text.