xpath 所有子标签text

        data =response.xpath("//div[@class='editor-style']")
        info= data[0].xpath('string(.)').extract()[0]
        questionss=response.xpath("//div[@class='editor-style']/p/strong/text()").extract()
        print(info)

 

 

其中,info就是所有子标签的内容了。

 

参考:
 

xpath 所有子标签text_第1张图片

你可能感兴趣的:(WEB开发)