probably you are looking for **XML tree and elements** XML is an inherently hierarchical data format, and the most natural way to represent it is with a tree. ET has two classes for this purpose - ElementTree represents the whole XML document as a tree, and Element represents a single node in this tree. Interactions with the whole document (reading and writing to/from files) are usually done on the ElementTree level. Interactions with a single XML element and its sub-elements are done on the Element level. 19.7.1.2. Parsing XML We’ll be using the following XML document as the sample data for this section:
1 2008 141100 4 2011 59900 68 2011 13600 У нас есть несколько способов импорта данных. Чтение файла с диска:
import xml.etree.ElementTree as ET tree = ET.parse('country_data.xml') root = tree.getroot()
Чтение данных из строки:
root = ET.fromstring(country_data_as_string)
Другое python Xml & amp; Html parser
https://wiki.python.org/moin/PythonXml http://docs.python.org/2/library/htmlparser.html