Element.get_id#

Element.get_id(default=None)[source]#

Gets the id attribute of the HTML element.

Parameters:

default (Any, default=None) – The value to return if the attribute does not exist.

Returns:

  • str – If the attribute exists.

  • None, Any – Retuns None if the attribute does not exist. However, if a default value is specified, it will be returned instead.