How to get all text children of an element in cElementTree?
问题 I'm using the cElementTree module in Python to get the text child of an XML tree, using the text property. But it seems to work only for the immediate text children (see below). $ python ... >>> import xml.etree.cElementTree as ET >>> root = ET.XML('<root><elm key="value">Some text</elm>More text</root>') >>> root.text >>> root = ET.XML('<root>Text 1<elm key="value">Text</elm>Text 2<elm2 />Text 3</root>') >>> root.text 'Text 1' >>> Is it possible to retrieve all immediate text children of a