'Need help to get a value of an xPath in puppeteer

I want to get the value of an exact xpath, that has a value of 1,400. Can not use any span or label class name because their are multiple classes with the same class or label name. So i have found out i have to use the Xpath. Any suggestions?

HTML:

<span class="currency-coins value">1,400</span>

Full xpath:

/html/body/main/section/section/div[2]/div/div/section[2]/div[2]/section/div[2]/ul/li[1]/div/div[2]/div[3]/span[2]/text()

Image of the Code



Solution 1:[1]

If the label is unique you can try:

//*[contains(text(), 'Kjop na')][0]/following-sibling::*

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Massimo Rebuglio