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

时间:2017-12-18 22:08:08

标签: function indexing google-sheets

我对Google表格上的功能有疑问。 我在一个单元格中写道:

  

=指数(IMPORTXML(" https://coinmarketcap.com/currencies/power-ledger/&#34 ;;" //跨度[@数据货币价格]&#34); 1)

它应该打印与本网站相同的值:click here 但它不是显示完全不同的价值。我不明白,我哪里错了?

1 个答案:

答案 0 :(得分:0)

在我的环境中,您的函数现在检索1.04。这与你的结果不一样。你可以尝试一下吗?

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

此函数从以下HTML中检索#####

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

如果这不起作用,我很抱歉。