Extractors implemented. Exporters name simplified. README Updated for extracting data. Removed go 1.11 support
This commit is contained in:
14
extractor/text.go
Normal file
14
extractor/text.go
Normal file
@ -0,0 +1,14 @@
|
||||
package extractor
|
||||
|
||||
import "github.com/PuerkitoBio/goquery"
|
||||
|
||||
// Text extracts texts from selected nodes
|
||||
type Text struct {
|
||||
Name string
|
||||
Selector string
|
||||
}
|
||||
|
||||
// Extract extracts texts from selected nodes
|
||||
func (e *Text) Extract(doc *goquery.Document) interface{} {
|
||||
return map[string]string{e.Name: doc.Find(e.Selector).Text()}
|
||||
}
|
Reference in New Issue
Block a user