I am trying to use this xpath to find the number of elements that have a value between X and Y. The problem I am facing is since there is   in the HTML, and the code doesn’t detect the text value.
Xpath:
//div[@class=”prix”]/div[2]/div[2]/span[1][number(translate(text(), “,”, “.”)) > 4 and number(translate(text(), “,”, “.”)) < 43]
HTML :
<div class=”d-flex-inline productPrice”>
<span>4,42 </span>
<span>€/HT</span>
</div>
I tried with replace(text(),” “,””) and replace(text(),” ”,””) and other combinations but nothing worked.
Source: Read More