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()
<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()