3 ms·
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
by chrissnell 11y ago
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.
- ericchiang 11y agorows := 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) } }
- chrissnell 11y agoThanks!