Moule Lin
← All notes

Scrapy

If a span contains other spans, for example

<span> <span>aa </span> <span>bb </span>cc</span>

adopt [-1] to acquire “cc” if I want to get it instead of text() directly
amount4 = ingredient.xpath(‘span[@class=”recipe__list-qty”]/text()’)[-1].get()