Akash Shinde
Akash Shinde

Reputation: 955

Parse html page and get value using css selector in golang

I want to parse value of particular div of HTML.Eg.I have class like "funcname" so can i parse value at this div in golang?

Upvotes: 8

Views: 8067

Answers (1)

Toni Cárdenas
Toni Cárdenas

Reputation: 6848

You can use the github.com/PuerkitoBio/goquery package. If you're familar with jQuery selectors, it won't be a problem for you.

doc, err := goquery.NewDocument(contents)
// handle err
doc.Find(".funcname")

Upvotes: 14

Related Questions