151-python解析xml文件

# from xml.dom import minidom
# path = r"/tmp/overview.html"
# dom_obj = minidom.parse(path)
#
# element_obj = dom_obj.documentElement
#
# table = dom_obj.getElementsByTagName("table")[0].getElementsByTagName("tr")[-1].getElementsByTagName("td")
# ret_list = []
# for item in table:
#     ret_list.append(item.childNodes[0].data.strip())
# print(ret_list)
posted @ 2021-01-20 16:21  楠海  阅读(53)  评论(0编辑  收藏  举报