Attribute extractor added. HTML extractor added. Outer HTML Extractor added.
exporter package renamed to export, extractor package renamed to extract for simplicity.
This commit is contained in:
14
extract/text.go
Normal file
14
extract/text.go
Normal file
@ -0,0 +1,14 @@
|
||||
package extract
|
||||
|
||||
import "github.com/PuerkitoBio/goquery"
|
||||
|
||||
// Text returns the combined text contents of provided selector.
|
||||
type Text struct {
|
||||
Name string
|
||||
Selector string
|
||||
}
|
||||
|
||||
// Extract returns the combined text contents of provided selector.
|
||||
func (e *Text) Extract(doc *goquery.Document) (interface{}, error) {
|
||||
return map[string]string{e.Name: doc.Find(e.Selector).Text()}, nil
|
||||
}
|
Reference in New Issue
Block a user