Using XPATH in python etree to select node with out a specific attribute

后端 未结 2 1568
执念已碎
执念已碎 2021-01-20 20:10

Following is my xml file contents,



    
        1
         


        
2条回答
  •  暖寄归人
    2021-01-20 20:40

    import xml.etree.ElementTree as etree
    
    xmlD = etree.parse('xmlTest.xml')
    root = xmlD.getroot()
    
    for child in root:
        for children in child:
            print(children.text)
    

提交回复
热议问题