を使用して次の地域の値を解析するにはどうすればよいlxml
ですか?
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<mstns:NewDataSet xmlns:mstns="AscentMetadataReport" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<mstns:Report>
<mstns:Metadata>
<mstns:Detail_Collection>
<mstns:Detail>
<mstns:Territory>ARGENTINA</mstns:Territory>
これが私が試したことです:
node=etree.fromstring(contents)
territory = node.find('NewDataSet/Report/Metadata/Detail_collection/Detail/Territory')
上記は機能していませんが。ここで領域を解析するにはどうすればよいですか?