Element.get_attr#
- Element.get_attr(name, default=None)[source]#
Gets the value of an HTML element attribute.
- Parameters:
name (str) – The name of the attribute.
default (Any, default=None) – The value to return if the attribute does not exist.
- Returns:
str – If the attribute exists.
None, Any –
Nonewill be returned the attribute does not exist. However, if a default value is specified, it will be returned instead.