xpath - Scrapy - Get all data within selector -
if have html in response looks like:
<body> body text <div> div text </div> </body>
if response.xpath('//body/text()').extract()
[body text]
i want everything inside <body>
including tags i.e. whole thing:
body text <div> div text </div>
how can accomplish that?
thank you.
try it:
response.xpath('//body/node()/text()')
or if want tags too:
response.xpath('//body/node()')
Comments
Post a Comment