Created
May 29, 2014 06:31
-
-
Save kyleconroy/ac8c34cb72fe2624dcc4 to your computer and use it in GitHub Desktop.
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 ( | |
"fmt" | |
"github.com/kyleconroy/soup" | |
) | |
func main() { | |
doc := soup.NewSoup(reader) | |
// Find a list of elements | |
divs := soup.FindAll("div") | |
// Find the first elelemnt | |
div := doc.Find("div.hello") | |
// Get an attribute | |
div.Attr("foo") | |
// Flatten the node into a string representation | |
div.String() | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment