You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

github.com/mvanbrummen/html-parser

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/mvanbrummen/html-parser

v0.0.0-20211109125443-e29e2ef4dd0d
Source
Go
Version published
Created
Source

HTML Parser

Toy html parser written in Go

Example

package main

import (
	"github.com/mvanbrummen/html-parser/dom"
	"github.com/mvanbrummen/html-parser/parser"
)

func main() {
	html := `
	<html>
		<body>
			<h1>Title</h1>
			<div id="main" class="test">
				<p>Hello <em>world</em>!</p>
			</div>
		</body>
	</html>
	`
	tree := parser.Parse(html)

	dom.PrintTree(tree)
}

FAQs

Package last updated on 09 Nov 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts