简体   繁体   中英

Need help to get a value of an xPath in puppeteer

I whant to get the value of an exect xpath, that has a value of 1,400. Can not use span class name because their are multiple classes with the same class 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()

代码图像

If the label is unique you can try:

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM