Next / Previous / Contents / Shipman's homepage

8.3. ElementTree.findtext(): Retrieve the text content from an element

To retrieve the text inside some element, use this method on some ElementTree instance ET:

ET.findtext(path[, default=None][, namespaces=N])

This method is essentially the same as calling the .findtext() method on the document's root element; see Section 9.7, “Element.findtext(): Extract text content”.