parser

package
v0.0.0-...-6554498 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2019 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ValidHosts map[string]bool

ValidHosts is a map of valid URLs that are then used for inspecting the returned HTML from a HTTP GET request, and is set by the main package.

Functions

func Init

func Init(p, h, s string)

Init configures the package from an outside mediator

Types

type Assets

type Assets []html.Token

Assets represents a collection of tokenized HTML elements.

type Page

type Page struct {
	Anchors Assets
	Links   Assets
	Scripts Assets
	URL     string
}

Page represents the tokenized elements of a HTML page.

func Parse

func Parse(page requester.Page, instr *instrumentator.Instr) Page

Parse accepts a read http.Request body and tokenizes it. It will construct a page struct consisting of the anchors, links and scripts for the given page.

func ParseCollection

func ParseCollection(pages []requester.Page, instr *instrumentator.Instr) []Page

ParseCollection concurrently parses a slice of requester.Page

Jump to

Keyboard shortcuts

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