docs: def getAttribute(self, attr: str) -> _AttrValueType:
          """Get attribute of this node as string format.
  
          If this node does not have ``attr``, return None.
          """
          if attr == 'class':
              if self.classList:
                  return self.classList.toString()
              return None
          attr_node = self.getAttributeNode(attr)
          if attr_node is None:
              return None
          return attr_node.value