parser

package
v0.0.0-...-d30cde0 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Parser

type Parser struct {
	// Represents the parsed jQuery like HTML document.
	Document *goquery.Document
}

Parser parses an HTML response body to extract metadata or update selectors.

func NewParser

func NewParser(dataReader io.Reader) (*Parser, error)

func (*Parser) ExtractMetadata

func (p *Parser) ExtractMetadata() *types.Metadata

ExtractMetadata extracts metadata from the document.

func (*Parser) ReplaceAssets

func (p *Parser) ReplaceAssets(transformer URLTransformer)

ReplaceAssets replaces assets within the HTML document using the provided transformation function. These assets that are linked or embedded in the document, such as images, CSS files, JavaScript files, fonts, etc., are essential for rendering the web page correctly and providing the desired functionality and appearance.

type URLTransformer

type URLTransformer func(string) (string, bool)

URLTransformer is a function type that transforms URLs.

Jump to

Keyboard shortcuts

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