xmlから特定の要素を抽出したいです。
<Relationships xmls="..."> <Relationship Id="rId7" Type="http://.../footer" Target="footer1.xml"/> <Relationship Id="rId9" Type="http://.../footer" Target="footer2.xml"/> </Relationships>
というxmlがあった時、IdのrId7とrId9、Targetのfooter1.xmlとfooter2.xmlを抽出したいです。
import xml.etree.ElementTree as ET tree = ET.parse('country_data.xml') root = tree.getroot()
のようにコードを書いたのですが、うまくパースできません。
どのようにコードを書けばいいのでしょうか?
どのようにうまくパースできないのでしょうか
回答1件
あなたの回答
tips
プレビュー