#coding=utf-8import refrom lxml import etreeimport requestsresponse = requests.get("http://yeves.cn/")content = response.content.decode()html = etree.HTML(content)res = html.xpath('/html/body/section/aside/div[1]/div/h3/text()')print(res)
本文共 241 字,大约阅读时间需要 1 分钟。
#coding=utf-8import refrom lxml import etreeimport requestsresponse = requests.get("http://yeves.cn/")content = response.content.decode()html = etree.HTML(content)res = html.xpath('/html/body/section/aside/div[1]/div/h3/text()')print(res)
转载地址:http://fmlwa.baihongyu.com/