import xml.dom.minidom dom = xml.dom.minidom.parse(r'K:\identify\voc_to_coco\cache\annotations\0.xml') # 打开xml文件,送到dom解析