简体   繁体   English

带有 Index() 函数的 ImportXML 返回错误值

[英]ImportXML with Index() function return wrong value

I have a problem with a function on Google Sheet.我对 Google Sheet 上的一个函数有问题。 I wrote this in a cell :我在一个单元格中写了这个:

=index(IMPORTXML(" https://coinmarketcap.com/currencies/power-ledger/ ";"//span[@data-currency-price]");1) =index(IMPORTXML(" https://coinmarketcap.com/currencies/power-ledger/ ";"//span[@data-currency-price]");1)

It should print the same value which is on this website : click here but instead of that it shows a complete different value.它应该打印与本网站上相同的值:单击此处,但它显示的是完全不同的值。 I don't get it, where am I wrong?我不明白,我哪里错了?

In my environment, your function retrieves 1.04 now.在我的环境中,您的函数现在检索 1.04。 This is not the same with your result.这与您的结果不同。 So can you try this?所以你可以试试这个吗?

=IMPORTXML("https://coinmarketcap.com/currencies/power-ledger/","//span[@id='quote_price']/@data-usd")

This function retrieves ##### from following HTML.此函数从以下 HTML 中检索#####

<span id="quote_price" data-currency-price data-usd="#####">

If this didn't work, I'm sorry.如果这不起作用,我很抱歉。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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