Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
是否可以使用 minidom 获取节点的名称?
例如我有一个节点:
<heading><![CDATA[5 year]]></heading>
我想要做的是存储值heading,以便我可以将它用作字典中的键。
heading
我能得到的最接近的是:
[<DOM Element: heading at 0x11e6d28>]
我确定我在这里忽略了一些非常简单的东西,谢谢。
你是这个意思吗?
tag= node.tagName d[tag]= node
tagName在 DOM Level 1 Core中定义,minidom(大部分)实现的基本标准。
tagName