pagser
pagser copied to clipboard
->exists() function which returns boolean if element exists
I implemented one:
func PagserExists(node *goquery.Selection, args ...string) (out interface{}, err error) {
return node.Length() > 0, nil
}
p.RegisterFunc("exists", PagserExists)
I think it could be added to core functions.
Which usages need to use this method?
I use it like this:
type data struct {
DialogExists bool `pagser:"#dialog->exists()"`
}
Ideally it would not be needed and the following would just work:
type data struct {
DialogExists bool `pagser:"#dialog"`
}
But it fails.