xpath获取某个节点下的全部字节点的文本

p_list = html.xpath("//div[@class='content']/p[1]")
for p in p_list:
    print(p.xpath('string(.)').strip())

 

posted @ 2020-12-18 11:57  阿磊小哥哥呀  阅读(1083)  评论(0编辑  收藏  举报