简体   繁体   English

Googlesheets function - IMPORTXML Xpath 用于 Yahoo Finance 中的文本 - 返回错误值

[英]Googlesheets function - IMPORTXML Xpath for text within Yahoo Finance - returning wrong value

I'm trying to get the last value at close for the product here:我试图在这里获得产品的最后一个值:

https://uk.finance.yahoo.com/quote/0P0000WN7H.L/history?p=0P0000WN7H.L https://uk.finance.yahoo.com/quote/0P0000WN7H.L/history?p=0P0000WN7H.L

It should be returning 576.06 for today's value (26/2/2021).对于今天的值 (26/2/2021),它应该返回 576.06。

I've tried using this formula in Google Sheets, which I saw recommended previously:我试过在 Google 表格中使用这个公式,我之前看到过推荐:

=IFNA(VALUE(IMPORTXML("https://finance.yahoo.com/quote/" & $A1, "//*[@class=""D(ib) Mend(20px)""]/span[1]")))

Where A1 is the ticker.其中 A1 是股票代码。 However this returns 748.92, which seems to be the result from the 9/11/2020, about three months ago.然而,这返回 748.92,这似乎是大约三个月前 2020 年 9 月 11 日的结果。

Any idea what's going wrong here and how I can get the right number?!知道这里出了什么问题以及如何获得正确的号码吗?

This is a screenshot:这是一个屏幕截图:

这是截图

thanks for the responses.感谢您的回复。 I eventaually got what I wanted using this, with L1 being the fund ticker:我最终得到了我想要的东西,L1 是基金代码:

=IMPORTHTML("http://finance.yahoo.com/q/hp?s="&$L$1&"+Historical+Prices","table")

Hope that's helpful to someone else.希望这对其他人有帮助。

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

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