Attributes
- pytidyhtml5.Attr(Node node=None)
An HTML attribute of a
pytidyhtml5.Node.
Getters
- Attr.node
Related node.
- Attr.name
Name of the attribute.
- Returns:
str – Name of the attribute
None – self is falsy
- Attr.value
Value of the attribute
- Returns:
str – Value of the attribute
None – self is falsy
- Attr.id
Numerical ID of the attribute.
- Returns:
TidyAttrId – ID of the attribute
int – The library reported an unknown value
None – self is falsy
- Attr.is_event
Returns whether the attribute is a JavaScript handler, e.g. onclick.
- Returns:
bool – Yes or no
None – self is falsy
Methods
- Attr.get_next(self)
The the next attribute of the Node.
- Returns:
Attr – The next attribute. Falsy if there was no further attribute.
None – self is falsy
Iterators
- Attr.__iter__()
Yields name and value
- Yields:
str – Name and value
None – self is falsy
Miscellaneous
- Attr.__bool__()
An Attr is truthy if the attribute exists and the Node did not expire.
- Attr.__eq__()
An Attr compares equal if the underlying attributes are the same, i.e. same attribute in the same Node in the same Document.
- Attr.__ne__()
Simply
not (self == other)
Getters as methods
All getters exist as methods, too:
|
Related node. |
|
Name of the attribute. |
|
Value of the attribute |
|
Numerical ID of the attribute. |
|
Returns whether the attribute is a JavaScript handler, e.g. onclick. |