html

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 24, 2026 License: MIT Imports: 10 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package html contains the html node implementation.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HTMLConfig

type HTMLConfig struct {
	// Tag is the CSS selector. Supported subset: tag, .class, #id,
	// [attr], [attr=value], descendant and child (>) combinators,
	// comma-separated groups.
	Tag string `json:"tag"`
	// Ret selects what each match produces: "html" (outer HTML,
	// default), "text" (element text), "val" (the value attribute),
	// or any other string naming an attribute (Node-RED semantics).
	Ret string `json:"ret"`
	// As selects the output shape: "single" (one message per match,
	// parts-tagged — Node-RED default) or "multi" (one message whose
	// payload is an array of matches).
	As string `json:"as"`
	// Property is the message property holding the HTML
	// (default "payload").
	Property string `json:"property"`
}

HTMLConfig holds configuration for the html node — the Node-RED `html` equivalent: it extracts elements from an HTML message payload via a CSS selector.

type HTMLNode

type HTMLNode struct {
	*nodebase.BaseNode
	// contains filtered or unexported fields
}

HTMLNode extracts elements/text/attributes from an HTML payload. "single" mode stashes matches for the MessageExpander hook so each match travels downstream as its own parts-tagged message.

func NewHTMLNode

func NewHTMLNode(node nodestore.NodeInterface, config *HTMLConfig) *HTMLNode

NewHTMLNode creates a new html node

func (*HTMLNode) Execute

Execute parses the payload HTML and evaluates the selector. "multi" returns an array payload directly; "single" stashes matches and returns an empty-Data shell expanded by Expand.

func (*HTMLNode) Expand

Expand turns stashed matches into one parts-tagged message per match (same parts {id,type,index,count} shape the split node produces so a downstream join can reassemble).

func (*HTMLNode) Validate

func (n *HTMLNode) Validate() error

Validate checks the html node configuration

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL