如何使用ettreepython从xml中获取所有子级的子值。 这是同样的数据
<try>
<place>
<c>place of the city <c>
</place>
<details>
<sex> male or female </sex>
<phone> phone no </phone>
<addresses>
<address>
<code>
<areacode> 91 </areacode>
</code>
<peraddr> the great city </peraddr>
</address>
<address>
<code>
<areacode> 9110 </areacode>
</code>
<peraddr> the great wall </peraddr>
</address>
</addresses>
</details>
</try>
如何获取所有区号和peraddr值。你知道吗
由于没有提供基本代码,有很多方法可以实现这一点。下面是一种可能的方法,它首先查找所有
address
元素,然后从每个address
打印areacode
和peraddr
值:相关问题 更多 >
编程相关推荐