Hero is coming back

风吹呀吹

风会指引你前进的方向

Python Xml

Python xml

生成Xml

from xml.etree.ElementTree import Element
from xml.etree.ElementTree import SubElement
from xml.etree.ElementTree import ElementTree
from xml.dom import minidom

root = Element('vedio')
cut = SubElement(root, 'cut')
time = SubElement(cut,'time')
time.text = '2'
tree = ElementTree(root)
tree.write('result.xml', encoding = 'utf-8')
# 

Xpath读取

import lxml
from lxml import etree

tree = etree.parse('result.xml')
tree.xpath("//div")

posted @ 2021-01-24 14:17  风吹呀吹  阅读(90)  评论(0编辑  收藏  举报