Closed Fawers closed 5 years ago
Hello,@Fawers, thanks for your suggestion, but the html.Node is another package type, Go can't extend existing types in another package, like as .Net extension methods.
I understand. Thought it could be done by defining an "alias" to html.Node
, but maybe I'm just imagining things?
Thought something in the lines of,
type Node html.Node
func (top *Node) FindOne(expr string) *Node { ... }
I'll give it a shot when I have the time!
Mm, seems it would require a lot of tweaking. Guess I'll just import htmlquery
with a shorter name then. :joy:
Thanks!
As of today, one must write, e.g.,
in order to retrieve the attribute
some-attribute
from an element. However, it would be more natural (IMO) and shorter to write, e.g.,I wouldn't mind trying and submitting a PR, as I'm just a Go rookie.
Btw, thanks for the great library! :slightly_smiling_face: