While scraping the content of a website, I encountered an issue with promotional prices which are crossed and replaced with another price (with <del>
and <ins>
html hypertext markups).
Here is the HTML source code of the bit I am trying to take:
<span class="price"><del>
<span class="woocommerce-Price-amount amount">
<bdi>49,00 <span class="woocommerce-Price-currencySymbol">MAD</span>
</bdi></span></del>
<ins><span class="woocommerce-Price-amount amount"><bdi>35,00 <span class="woocommerce-Price-currencySymbol">MAD</span></bdi></span></ins></span>
I am trying to select only the part in <ins>
.
I have so far used this code to extract the price, but it makes no distinction between the crossed and actual price.
sourceCode.xpath('//span[@class="price"]/descendant::node()/text()')
I cannot figure out how to only select the <ins>
part.