parsing an xml file for unknown elements using python ElementTree
问题 I wish to extract all the tag names and their corresponding data from a multi-purpose xml file. Then save that information into a python dictionary (e.g tag = key, data = value). The catch being the tags names and values are unknown and of unknown quantity. <some_root_name> <tag_x>bubbles</tag_x> <tag_y>car</tag_y> <tag...>42</tag...> </some_root_name> I'm using ElementTree and can successfully extract the root tag and can extract values by referencing the tag names, but haven't been able to