xml.etree.ElementTree.Element.getchildren()

getchildren() Deprecated since version 3.2: Use list(elem) or iteration.

xml.etree.ElementTree.Element.findtext()

findtext(match, default=None, namespaces=None) Finds text for the first subelement matching match. match may be a tag name or a path. Returns the text content of the first matching element, or default if no element was found. Note that if the matching element has no text content an empty string is returned. namespaces is an optional mapping from namespace prefix to full name.

xml.etree.ElementTree.Element.getiterator()

getiterator(tag=None) Deprecated since version 3.2: Use method Element.iter() instead.

xml.etree.ElementTree.Element.findall()

findall(match, namespaces=None) Finds all matching subelements, by tag name or path. Returns a list containing all matching elements in document order. namespaces is an optional mapping from namespace prefix to full name.

xml.etree.ElementTree.Element.get()

get(key, default=None) Gets the element attribute named key. Returns the attribute value, or default if the attribute was not found.

xml.etree.ElementTree.Element.clear()

clear() Resets an element. This function removes all subelements, clears all attributes, and sets the text and tail attributes to None.

xml.etree.ElementTree.Element

class xml.etree.ElementTree.Element(tag, attrib={}, **extra) Element class. This class defines the Element interface, and provides a reference implementation of this interface. The element name, attribute names, and attribute values can be either bytestrings or Unicode strings. tag is the element name. attrib is an optional dictionary, containing element attributes. extra contains additional attributes, given as keyword arguments. tag A string identifying what kind of data this element re

xml.etree.ElementTree.Element.find()

find(match, namespaces=None) Finds the first subelement matching match. match may be a tag name or a path. Returns an element instance or None. namespaces is an optional mapping from namespace prefix to full name.

xml.etree.ElementTree.Element.attrib

attrib A dictionary containing the element’s attributes. Note that while the attrib value is always a real mutable Python dictionary, an ElementTree implementation may choose to use another internal representation, and create the dictionary only if someone asks for it. To take advantage of such implementations, use the dictionary methods below whenever possible.

xml.etree.ElementTree.Element.extend()

extend(subelements) Appends subelements from a sequence object with zero or more elements. Raises TypeError if a subelement is not an Element. New in version 3.2.