goq icon indicating copy to clipboard operation
goq copied to clipboard

Document selectors (issue?)

Open azukaar opened this issue 5 years ago • 0 comments

I'm having an issue with selectors, and in general they're hard to deal with because they are not documented, neither here nor in GoQuery.

I have this markup:

image

And I select :

type Categorie struct {
	Text string `goquery:"a,text"`
	Link string `goquery:"a,[href]"`
	Sub []Categorie `goquery:"ul"`
}

type Menu struct {
	Categorie []Categorie `goquery:".menu-l1-li-hld li"`
}

I would expect text and href from links to return 1 of each, but I have a weird result where text append every sub text together, but href doesn't. Is it an issue with the lib?

image

Thanks

azukaar avatar Oct 23 '19 17:10 azukaar