How to use Python XML findall to find ”

With ElementTree in Python 3.8, you can simply use a wildcard ({*}) for the namespace:

results = ET.fromstring(xml).findall(".//{*}imagedata") 

Note the .// part, which means that the whole document (all descendants) is searched.

Leave a Comment