Element.get_attr#

Element.get_attr(name)[source]#

Gets the value of an HTML element attribute.

Parameters:

name (str) – The name of the attribute.

Returns:

  • str – If the attribute exists.

  • None – If the attribute does not exist.