Re:Scrape: A simple, higher level interface for Go web scraping
by chrissnell on Sunday May 24, 2015 @12:08AM
(#9595273)
This is very cool. I'm not much of a front-end guy so I'm struggling with the examples. Would you mind posting up a simple example that will scrape--say--the first TD tag of every row of a table? Thanks.
[ Parent
| on HN ]
Re:Scrape: A simple, higher level interface for Go web scraping
by ericchiang on Sunday May 24, 2015 @12:46AM
(#9595331)
rows := scrape.FindAll(table, scrape.ByTag(atom.Tr))
cols := []*html.Node{}
for _, row := range rows {
// Find returns the first result
col, ok := scrape.Find(row, scrape.ByTag(atom.Td))
if ok {
cols = append(cols, col)
}
}
Re:Scrape: A simple, higher level interface for Go web scraping
by chrissnell on Sunday May 24, 2015 @04:15PM
(#9597415)
Thanks!