为什么我们在这里使用'特殊检查命名空间对象内容:媒体'?

时间:2017-07-06 16:31:47

标签: python python-3.x xml-parsing

我遇到了这个python代码。

centre loss

有人可以告诉我这里的内容:媒体是什么?我们为什么这样做?我无法在互联网上找到有关实际情况的内容。

1 个答案:

答案 0 :(得分:0)

这是SOAP API元素。例如:

 <?xml version="1.0"?>
<soap:Envelope
xmlns:soap="http://www.w3.org/2003/05/soap-envelope/"
soap:encodingStyle="http://www.w3.org/2003/05/soap-encoding">

<soap:Body>
    <m:GetPrice xmlns:m="https://www.w3schools.com/prices">
        <m:Item>Apples</m:Item>
    </m:GetPrice>
</soap:Body>

</soap:Envelope>

在以前的XML文件中,如果您想获得<Item>Apples</Item>。你必须使用:

body.find('{https://www.w3schools.com/prices}Item')