吃瓜的瓜农

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理
import html
import etree
selector = etree.HTML(res)
url_h2 = selector.xpath("//a[@_stat='video:poster_v']/../h2")[0]
url_div = selector.xpath("//a[@_stat='video:poster_v']/../div")[0]
url_h2 = etree.tostring(url_h2).decode()
url_div = etree.tostring(url_div).decode()
print("******", url, url_img, html.unescape(url_h2), html.unescape(url_div))
posted on 2019-02-11 22:59  吃瓜的瓜农  阅读(1039)  评论(0编辑  收藏  举报