[Python-de] Bestimmte XML Tags auslesen mit Python

Lutz Horn lutz.georg.horn at googlemail.com
Fr Aug 3 12:24:21 CEST 2007


Hallo,

Am 03.08.07 schrieb Christoph Heer <christoph.heer at googlemail.com>:
> > > Das wenn das File:
> > > <name>Christoph Heer</name>
> > >
> > > beinhaltet das dann nur der Name also Christoph Heer ausgeben wird.

<code>
import xml.dom.minidom
s = """<name>Christoph Heer</name>"""
print  dom.getElementsByTagName("name")[0].childNodes[0].data
</code>

Siehe dazu <http://docs.python.org/lib/module-xml.dom.minidom.html>.

Lutz




Mehr Informationen über die Mailingliste python-de