WhakerPy 0.8

https://sourceforge.net/projects/whakerpy/

Module whakerpy.htmlmaker

Class HTMLNode

Constructor

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.
View Source
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