开发者

Get node name with minidom

开发者 https://www.devze.com 2022-12-29 11:13 出处:网络
Is it possible to get the name of a node using minidom? For example I have a node: <heading><![CDATA[5 year]]></heading>

Is it possible to get the name of a node using minidom?

For example I have a node:

<heading><![CDATA[5 year]]></heading>

What I'm trying to do, is store the value heading so that I can use it as a key in a dictionary.

The closest I can get is something like:

[<DOM Element: heading at 0x11e6d28>]
开发者_如何转开发

I'm sure I'm overlooking something very simple here, thanks.


Is this what you mean?

tag= node.tagName
d[tag]= node

tagName is defined in DOM Level 1 Core, the basic standard that minidom (mostly) implements.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号