Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Parse html page and get value using css selector in golang

Tags:

go

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?

like image 942
Akash Shinde Avatar asked Jan 17 '15 11:01

Akash Shinde


1 Answers

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")
like image 88
Toni Cárdenas Avatar answered Nov 15 '22 06:11

Toni Cárdenas