动态

详情 返回 返回

xpath匹配一個標籤下所有內容 - 动态 详情

from lxml import etree
import requests

url = 'http://www.shihuo.cn/youhui/474770.html#qk=youhui_list'
response = requests.get(url)
text = etree.HTML(response.text)

tt = text.xpath("//div[@class='article']")
info = tt[0].xpath("string(.)")

user avatar u_17494575 头像 u_17353607 头像 u_14540126 头像 u_15505879 头像 itwhat 头像 xingchendahai_68d7dff410962 头像 yejianfeixue 头像 chiqingdezhentou 头像 haoqidedalianmao 头像 lintp 头像 yanyingjie 头像 gqkmiss 头像
点赞 18 用户, 点赞了这篇动态!
点赞

Add a new 评论

Some HTML is okay.