How can I extract content from within commented tags with scrappy ?
For instance, how to extract "Yellow" in the following example:
<div class="fruit">
<div class="infos">
<h2 class="Name">Banana</h2>
<span class="edible">Edible: Yes</span>
</div>
<!--
<p class="color">Yellow</p>
-->
</div>
You can use an XPath expression like
//comment()
to get the comment content, and then parse that content after having stripped the comment tags.Example scrapy shell session:
First of all, use below xpath to get all the comments from the page.
Now, using any key value identity your meaning comments.
define,