Create a tag node to represent any HTML element.
Parameters
- parent: (str) Parent identifier
- identifier: (str) This node identifier
Raises
- NodeTagError: Invalid tag. Not in the HTML_TAGS list.
Create a tag node to represent any HTML element.
def __init__(self, parent: str, identifier: str, tag: str, attributes=dict(), value=None):
"""Create a tag node to represent any HTML element.
:param parent: (str) Parent identifier
:param identifier: (str) This node identifier
:raises: NodeTagError: Invalid tag. Not in the HTML_TAGS list.
"""
self._children = list()
super(HTMLNode, self).__init__(parent, identifier, tag, attributes)
if self.tag not in HTML_TAGS.keys():
raise NodeTagError(tag)
self._value = value