Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/html_parser/src/mod.ts

Port of fb55/htmlparser2 for Deno
Latest
import * as htmlParser from "https://deno.land/x/html_parser@v0.1.3/src/mod.ts";

Enums

Types of elements found in htmlparser2's DOM

Variables

Type for

Type for

Type for

Type for <!doctype ...>

Type for the root element of a document

Type for tags

Type for tags

Type for Any tag

Type for Text

Functions

Creates a parser instance, with an attached DOM handler.

Append an element after another.

Append a child to an element.

Compare the position of one node against another node in any other document. The return value is a bitmask with the following values:

Search a node and its children for nodes passing a test function.

Search an array of node and its children for nodes passing a test function.

Search and array of nodes and its children for nodes passing a test function.

Finds one element in a tree that passes a test.

Finds the first element inside of an array that matches a test function.

Gets an attribute from an element.

Get a node's children.

Get the tag name of an element.

Gets an elements siblings, including the element itself.

f
DomUtils.getText
deprecated

Get a node's inner text. Same as textContent, but inserts newlines for <br> tags.

Checks whether an element has an attribute.

Get a node's inner text.

Returns the next element sibling of a node.

Prepend an element before another.

Prepend a child to an element.

Returns the previous element sibling of a node.

Remove an element from the dom

Given an array of nodes, remove any member that is contained by another.

Replace an element in the dom

Get a node's text content.

Sort an array of nodes based on their relative position in the document and remove any duplicate nodes. If the array contains nodes that do not belong to the same document, sort order is unspecified.

Tests whether an element is a tag or not.

Parses the data, returns the resulting document.

f
parseDOM
deprecated

Parses data, returns an array of the root nodes.

Parse a feed.