Doctype with goquery

233 Views Asked by At

Is there any possibility to retrieve document doctype with goquery?

I've tried several things, but any worked. I suppose that it is possible, because NodeName func has switch with "html.DoctypeNode" case.

That code didn't find doctype:

doc.Find("~").Each(func(_ int, item *goquery.Selection) {
    fmt.Println(goquery.NodeName(item))
})
1

There are 1 best solutions below

0
On

It doesn't seem like there is a reliable way to retrieve the doctype using either jQuery itself (in the web browser) or goquery on the backend.