Reputation: 11618
>>> import xml.etree.ElementTree as ET
>>> t = ET.fromstring('<root><field name="tcp.option_len" ></field></root>')
>>> t.findall('.//field [@name="tcp.option_len"]')
[]
Why isn't the field
returned?
Upvotes: 0
Views: 43
Reputation: 4668
Simply remove the space in the XPath query b/n field and the bracket [
t.findall('.//field[@name="tcp.option_len"]')
Upvotes: 2