hdq – HTML DOM Query Language for Go+

Build Status Go Report Card GitHub release Coverage Status Language GoDoc

Summary about hdq

hdq is a Go+ package for processing HTML documents.

Tutorials

Collect links of a html page

How to collect all links of a html page? If you use hdq, it is very easy.

<div class="highlight highlight-source-go position-relative" data-snippet-clipboard-copy-content="import " github.com qiniu hdq" func links(url interface{}) []string { doc := hdq.Source(url) return [link for a

import "github.com/qiniu/hdq"

func links(url interface{}) []string {
	doc := hdq.Source(url)
	return [link for a <- doc.any.a, link := a.href?:""; link != ""]
}