<p class="result-price">
<span>Price</span>
$25.00 |
<span>Member Price</span>
$25.00
<span>(0% discount)</span>
</p>
<p class="result-rating">
From the above HTML tags u can notice that the $25.00 | is just a text and is not associated with any HTML tags, I wrote the following x-path to retrieve it :
//div[contains(@data-title,'Rafael B.: Arrangement and Composition')]/div[3]/p[1]/text()[2].
and it did extract the text but in the xpath checker the result is displayed inside a container. when I use the same x-path in my script, its not retrieving the text value.
Can somebody please help.Looks like the text is inside a container/ text-area
Here a way to retrieve price :
//span[text()="Price"]/following-sibling::text()[1]
or
//p[@class="result-price"]/span[1]/following-sibling::text()[1]
Here the easiest way:
//p[contains(.,'$25.00')]
or you can find any text like below
//p[contains(.,'%replaceText%')]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With