getlinks

A simple Go library to get all the links from an HTML page

Stars
7
Committers
1

getlinks

A very simple way to get links from web page. This library uses the domain of the webpage to correctly parse relative links.

Install

go get -u github.com/schollz/getlinks

Usage

urlString := "https://en.wikipedia.org/w/index.php?title=Pauli_exclusion_principle&oldid=854810355"
resp, _ := http.Get(urlString)
defer resp.Body.Close()

links, _ := getlinks.GetLinks(resp.Body, urlString)
fmt.Println(links)

Contributing

Pull requests are welcome. Feel free to...

  • Revise documentation
  • Add new features
  • Fix bugs
  • Suggest improvements

License

MIT