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§
- Document
Node - A key representing a single HtmlNode contained in a HtmlDocument.
- Html
Document - HTML document tree represented by an indextree arena and a root node.
- HtmlTag
- An HTML tag and its attributes.
- Html
Text - Text content in an HTML document.
Enums§
- Document
Format Type - Describes the formatting when converting an HtmlDocument to a string.
- Html
Node - 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.