forked from ukamnya/microdata_mirror
Added subitems
parent
cc14cf6b0c
commit
da8a656b05
|
@ -4,6 +4,7 @@ import (
|
|||
"bytes"
|
||||
"code.google.com/p/go-html-transform/h5"
|
||||
"io"
|
||||
"net/url"
|
||||
"strings"
|
||||
)
|
||||
|
||||
|
@ -48,7 +49,7 @@ type Parser struct {
|
|||
identifiedNodes map[string]*h5.Node
|
||||
}
|
||||
|
||||
func NewParser(r io.Reader) *Parser {
|
||||
func NewParser(r io.Reader, url.URL) *Parser {
|
||||
return &Parser{
|
||||
p: h5.NewParser(r),
|
||||
data: NewMicrodata(),
|
||||
|
|
|
@ -6,7 +6,7 @@ import (
|
|||
)
|
||||
|
||||
func ParseData(html string, t *testing.T) *Microdata {
|
||||
p := NewParser(strings.NewReader(html))
|
||||
p := NewParser(strings.NewReader(html), url.URL("http://example.com/")
|
||||
|
||||
data, err := p.Parse()
|
||||
if err != nil {
|
||||
|
|
Loading…
Reference in New Issue