雅虎财经对Google表格的历史收盘价在100天后返回n/a

编程入门 行业动态 更新时间:2024-10-22 20:32:43
本文介绍了雅虎财经对Google表格的历史收盘价在100天后返回n/a的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我尝试打印从Yahoo财务到Google表格的历史调整后收盘价.

I try to print historic adjusted close prices from Yahoo finance to Google Sheets.

=ImportXML("sg.finance.yahoo/quote/"&B57&"/history?p="&B57, "//tbody/tr[21]/td[6]")

单元格B57例如是"SPY".

此功能适用于长达100天的历史价格. (在此处进行调整:tr[100])

This works fine for historic prices up to 100 days. (it is adjusted here: tr[100])

当我尝试在100天后获得价格时,它会返回"N/A". 这些价格在雅虎财经上可见.

When I try to get prices later 100 days it returns "N/A". These prices are visible on yahoo finance.

是否有一种方法可以调整XPATH的正常工作?

It there a way to adjust XPATH that it works?

我注意到,在Yahoo Pices的html代码中,大约100天在tr标签中没有此"data-reactid = 1520".

I noticed, that in the html code of yahoo pices about 100 days don't have this "data-reactid=1520" in the tr tag.

提前谢谢!

推荐答案

答案:

IMPORTXML无法检索由脚本填充的数据,因此无法使用此公式从该表中检索数据.

Answer:

IMPORTXML can not retrieve data which is populated by a script, and so using this formula to retrieve data from this table is not possible to do.

在不使用JavaScript的情况下将前100个值加载到页面中(如您通过为 sg.finance.yahoo/quote/SPY/history?p=SPY 并重新加载页面),则可以通过.

As the first 100 values are loaded into the page without the use of JavaScript (as you can see by disabling JavaScript for sg.finance.yahoo/quote/SPY/history?p=SPY and reloading the page), the information can be retrieved by IMPORTXML.

由于向下滚动页面后即时生成了前100个结果之后的数据,因此IMPORTXML无法检索新的可用数据-就公式而言,没有101 st <tr>元素,因此显示N/A: Imported content is empty.

As the data after the first 100 results is generated on-the-fly after scrolling down the page, the newly available data is not retrievable by IMPORTXML - as far as the formula sees, there is no 101st <tr> element and so it displays N/A: Imported content is empty .

我知道这通常是个坏消息,但我希望这对您有帮助!

I know this is generally bad news, but I hope this is helpful to you!

  • IMPORTXML-文档编辑器帮助
  • Google表格importXML返回空值

更多推荐

雅虎财经对Google表格的历史收盘价在100天后返回n/a

本文发布于:2023-10-25 22:01:26,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1528234.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:收盘价   雅虎   天后   表格   财经

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!