我将如何使用解析以下区域值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')
尽管上述方法不起作用。我将如何解析这里的领土?