Quantcast
Channel: Parsing XML in python: selecting an attribute given that a child node has a specific attribute - Stack Overflow
Browsing all 3 articles
Browse latest View live

Answer by oppressionslayer for Parsing XML in python: selecting an attribute...

You can also get those values as keys, which makes it a bit more structured approach to gather data:import xml.etree.ElementTree as ETroot = ET.fromstring(xmlstr)wht =root.find(".//Description")...

View Article



Answer by alecxe for Parsing XML in python: selecting an attribute given that...

You've definitely hit that XPath limited support limitation as, if we look at the source directly (looking at 3.7 source code), we could see that while parsing the Element Path expression, only these...

View Article

Parsing XML in python: selecting an attribute given that a child node has a...

Given the xml xmlstr = '''<myxml><Description id="10"><child info="myurl"/></Description></myxml>'I'd like to get the id of Description only where child has an attribute...

View Article
Browsing all 3 articles
Browse latest View live




Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>
<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596344.js" async> </script>