这是我的意见:
使用python 2.4
<?xml version="1.0" encoding="UTF-8" ?>
<Status>
<_IGPS>
<Lat>03°14'48"N</Lat>
<Lon>117°35'03"E</Lon>
<Type>3D</Type>
<Status>allowed</Status>
<Time>17/01/25,09:12:02</Time>
</_IGPS>
我只想用Lat注销这个。你知道吗
这是我使用的代码:
doc = minidom.parse("t.xml")
temp = doc.getElementsByTagName("_IGPS")
if i print this i get => "<xml.dom.minidom.Document instance at 0x02C01E68>"
*** This is the part that i cant figure out to extract the actualy values ***
当我试着做以下事情的时候:
print(temp.** at this point the interpeter does not know what is the type of temp**
我用这个网站作为参考来做什么:
https://www.mkyong.com/python/python-read-xml-file-dom-example/
对于您的示例,您可以使用下一个代码,在那里您将获得值Lat和Lon。你知道吗
相关问题 更多 >
编程相关推荐