Understand the Root struct and Error handling
mainThe Root struct is the primary object returned by parsing and DOM navigation methods. It contains:
Pointer: The pointer to the current HTML node.NodeValue: The current node's value (tag name forElementNode, text forTextNode).Error: An error object if an operation failed, otherwisenil.
If Error is not nil, you can check the Type field (of type ErrorType) to identify the specific issue. Supported error types include:
ErrUnableToParseErrElementNotFoundErrNoNextSibling/ErrNoPreviousSibling/ErrNoNextElementSibling/ErrNoPreviousElementSiblingErrCreatingGetRequest/ErrInGetRequest/ErrReadingResponse