extract is a simple library for extracting elements from a web page. It provides simple higher level functions based upon Cascadia and html packages.
For example,
package main
import (
"fmt"
"log"
"github.com/hariharan-uno/extract"
)
func main() {
l, err := extract.Links("http://google.com")
if err != nil {
log.Fatal(err)
}
fmt.Println(l)
}
package main
import (
"fmt"
"log"
"github.com/hariharan-uno/extract"
)
func main() {
i, err := extract.Images("http://google.com")
if err != nil {
log.Fatal(err)
}
fmt.Println(i)
}
Currently, only the functions extract.Links()
and extract.Images()
are supported. If you'd like a specific function to be supported, please file an issue.