xpath获取某个节点下的全部字节点的文本 p_list = html.xpath("//div[@class='content']/p[1]") for p in p_list: print(p.xpath('string(.)').strip())