立即学习:https://edu.csdn.net/course/play/24454/306777?utm_source=blogtoedu
from lxml import etree
etree.parse('./xxx.html')本地脱机文件
etree.HTML('page_text')网页
r = tree.xpath('//div[@class=""]//li[3]/a/text()')[0] "/"代表取直系内容,"//"跨层级选取
取文本:/text()直系文本内容 //text
r=tree.xpath('//div[@class=""]/img/@src')选取标签中的属性