Struct scraper::html::Html[][src]

pub struct Html {
    pub errors: Vec<Cow<'static, str>>,
    pub quirks_mode: QuirksMode,
    pub tree: Tree<Node>,
}

An HTML tree.

Parsing does not fail hard. Instead, the quirks_mode is set and errors are added to the errors field. The tree will still be populated as best as possible.

Implements the TreeSink trait from the html5ever crate, which allows HTML to be parsed.

Fields

Parse errors.

The quirks mode.

The node tree.

Methods

impl Html
[src]

Creates an empty HTML document.

Creates an empty HTML fragment.

Parses a string of HTML as a document.

Parses a string of HTML as a fragment.

Important traits for Select<'a, 'b>

Returns an iterator over elements matching a selector.

Trait Implementations

impl TreeSink for Html
[src]

Note: does not support the <template> element.

The overall result of parsing. Read more

Handle is a reference to a DOM node. The tree builder requires that a Handle implements Clone to get another reference to the same node. Read more

Consume this sink and return the overall result of parsing. Read more

Signal a parse error.

Set the document's quirks mode.

Get a handle to the Document node.

Do two handles refer to the same node?

What is the name of this element? Read more

Create an element. Read more

Create a comment node.

Append a DOCTYPE element to the Document node.

Append a node as the last child of the given node. If this would produce adjacent sibling text nodes, it should concatenate the text instead. Read more

Append a node as the sibling immediately before the given node. Read more

Detach the given node from its parent.

Remove all the children from node and append them to new_parent.

Add each attribute to the given element, if no attribute with that name already exists. The tree builder promises this will never be called with something else than an element. Read more

Get a handle to a template's template contents. The tree builder promises this will never be called with something else than a template element. Read more

Mark a HTML <script> as "already started".

Create a Processing Instruction node.

When the insertion point is decided by the existence of a parent node of the element, we consider both possibilities and send the element which will be used if a parent node exists, along with the element to be used if there isn't one. Read more

Indicate that a node was popped off the stack of open elements.

Associate the given form-associatable element with the form element

Returns true if the adjusted current node is an HTML integration point and the token is a start tag. Read more

Called whenever the line number changes.

Indicate that a script element is complete.

impl Debug for Html
[src]

Formats the value using the given formatter. Read more

impl Clone for Html
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl PartialEq for Html
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

impl Eq for Html
[src]

Auto Trait Implementations

impl !Send for Html

impl !Sync for Html