Get Element value with minidom with Python

前端 未结 9 2020
悲&欢浪女
悲&欢浪女 2020-11-29 18:01

I am creating a GUI frontend for the Eve Online API in Python.

I have successfully pulled the XML data from their server.

I am trying to grab the value from

9条回答
  •  甜味超标
    2020-11-29 18:24

    Here is a slightly modified answer of Henrik's for multiple nodes (ie. when getElementsByTagName returns more than one instance)

    images = xml.getElementsByTagName("imageUrl")
    for i in images:
        print " ".join(t.nodeValue for t in i.childNodes if t.nodeType == t.TEXT_NODE)
    

提交回复
热议问题