Skip to content

phynalle/kiteroot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

kiteroot

kiteroot is a convenient tool to play with html tag for Go.

The project is inspired by BeautifulSoup written for Python.

To select tags after parse, you can use these functions: Find, FindAll, FindWithAttrs, FindAllWithAttrs.

var r io.Reader
...

doc, _ := kiteroot.Parse(r) 

// you can get urls of all links in the document you parse like this:
links := doc.FindAll("a")
for _, link := links {
  fmt.Println(link.Attribute("href"))
}

// you can also find a tag containing specific attributes.
title := doc.FindWithAttrs("span", kiteroot.MakeAttrs("class", "title"))
// And it is same with: title := doc.Find("span", "class", "title")

About

Convenient helper to play with HTML tag for Go

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages