Skip to main content
Latest
class cheerio.Node
Abstract
import { cheerio } from "https://deno.land/x/deno_temme@v1.0.0/deps.ts";
const { Node } = cheerio;

This object will be used as the prototype for Nodes when creating a DOM-Level-1-compliant structure.

Properties

endIndex: number | null

The end index of the node. Requires withEndIndices on the handler to be `true.

next: ChildNode | null

Next sibling

nextSibling: ChildNode | null

Same as next. DOM spec-compatible alias.

abstract
readonly
nodeType: number

DOM spec-compatible node type.

parent: ParentNode | null

Parent of the node

parentNode: ParentNode | null

Same as parent. DOM spec-compatible alias.

prev: ChildNode | null

Previous sibling

previousSibling: ChildNode | null

Same as prev. DOM spec-compatible alias.

optional
sourceCodeLocation: SourceCodeLocation | null

parse5 source code location info.

Available if parsing with parse5 and location info is enabled.

startIndex: number | null

The start index of the node. Requires withStartIndices on the handler to be `true.

abstract
readonly
type: ElementType

The type of the node.

Methods

cloneNode<T extends Node>(this: T, recursive?: boolean): T

Clone this node, and optionally its children.