I am parsing an XML file using xml.etree.ElementTree. I want to find elements based off the name attribute.
fnd = root.findall("./player[@name='Pqp239']")
fnd = root.findall("./player[@name='rob']")
import lxml.etree as ET tree = ET.parse("input.xml") root = tree.getroot() root.xpath("./player[contains(@name, 'rob')]")
Note though, that to make the partial match case-insensitive you would need to additionally apply the