scrapy - How to exclude certain paths of xpath without getting scraped? -
i tried scrap data neccesary, when trying exclude part not needed, unable that. please in scraping data necessary?
case - 1:
<div class="abc xyz"> <div class="aaaaaa bbbbbb"> "i dont want include this" </div> ***"i want scrap this"*** </div>
case - 2:
<div class="abc xyz"> <div class="aaaaaa bbbbbb"> </div> ***"i want scrap this"*** </div>
both cases, output tried "i want scrap this".
already tried scraping using './/div[contains(@class,"abc")]//text()' - in first case giving output "i dont want include thisi want scrap this", in second case expected output scraped.
this 1 have garbage in result, job:
result = response.xpath('//div[@class="abc xyz"]/text()').extract() result = "".join(result)
Comments
Post a Comment