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

x/html_parser/src/utils/mod.ts>findOne

Port of fb55/htmlparser2 for Deno
Latest
function findOne
Re-export
import { findOne } from "https://deno.land/x/html_parser@v0.1.3/src/utils/mod.ts";

Finds one element in a tree that passes a test.

Parameters

test: (elem: Element) => boolean

Function to test nodes on.

nodes: Node[]

Array of nodes to search.

optional
recurse = [UNSUPPORTED]

Also consider child nodes.

Returns

Element | null

The first child node that passes test.