Last active
November 18, 2016 10:33
-
-
Save sometimesfood/c102287b7aa2270df95ef16553159e6e to your computer and use it in GitHub Desktop.
Simple goquery demo
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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