I've called elems = xmldoc.getElementsByTagName('myTagName')
on an XML object that I parsed as minidom.parse(xmlObj)
. Now I'm trying to get the text content of this element, and although I spent a while looking through the dir() and trying things out, I haven't found the call yet. As an example of what I want to accomplish, in:
<myTagName> Hello there </myTagName>
I would like the extract just "Hello there". (obviously I could parse this myself but I expect there is some built-in functionality)
Thanks
Try like this:
xmldoc.getElementsByTagName('myTagName')[0].firstChild.nodeValue