【发布时间】:2016-08-07 03:51:55
【问题描述】:
在我的 xml 文件中,我有这样的节点:
<waitingJobs idList="J03ac2db8 J03ac2fb0"/>
我知道如何使用.findall 来搜索属性,但现在看来我需要使用正则表达式,因为I can't just use
root.findall('./[@attrib='value']')
我必须使用
root.findall('./[@attrib='*value*']')
问题
-
xml.etree可以做到这一点吗? -
lxml如何做到这一点?
【问题讨论】: