python 解析XML python模块xml.dom解析xml实例代码

上传:yihao51938 浏览: 37 推荐: 0 文件:PDF 大小:45.7KB 上传时间:2020-12-31 07:37:03 版权申诉
一 、python模块 xml.dom 解析XML的APIminidom.parse(filename)加载读取XML文件 doc.documentElement获取XML文档对象 node.getAttribute(AttributeName)获取XML节点属性值 node.getElementsByTagName(TagName)获取XML节点对象集合 node.childNodes #返回子节点列表。 node.childNodes[index].nodeValue获取XML节点值 node.firstChild#访问第一个节点。等价于pagexml.childNodes[0] doc
上传资源
用户评论