Skip to content

Instantly share code, notes, and snippets.

@sometimesfood
Last active November 18, 2016 10:33
Show Gist options
  • Save sometimesfood/c102287b7aa2270df95ef16553159e6e to your computer and use it in GitHub Desktop.
Save sometimesfood/c102287b7aa2270df95ef16553159e6e to your computer and use it in GitHub Desktop.
Simple goquery demo
package main
import (
"log"
"fmt"
"github.com/PuerkitoBio/goquery"
)
func main() {
doc, err := goquery.NewDocument("https://www.microsoft.com")
if err != nil {
log.Fatal(err)
}
doc.Find("#shell-header").Each(func(_ int, s *goquery.Selection) {
fmt.Printf(s.Text())
})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment