o conteúdo do arquivo especificado Leia xml

def read_xml(path, tag_name='QW', attribute_name='value'):
    dom_tree = xml_parse(path)
    root_node = dom_tree.documentElement
    tag_list = root_node.getElementsByTagName(tag_name)
    details = ''
    for tag in tag_list:
        if tag.hasAttribute(attribute_name):
            details += tag.getAttribute(attribute_name)
    return details

Lançado nove artigos originais · ganhou elogios 2 · Visualizações 314

Acho que você gosta

Origin blog.csdn.net/Z_Pythagoras/article/details/105060419
Recomendado
Clasificación