【发布时间】:2021-02-03 16:00:08
【问题描述】:
我正在尝试使用网页抓取 ImportXml Xpath 从 Yahoo Finance 获取股票信息,并将其放入我的 Google 表格中。我可以让它与 %change 一起使用,但不能与价格一起使用,在那里我得到了一个我在页面上任何地方都没有重新计算的数字,任何人都可以帮助我。 我的价格的 xmlImport 如下所示:
=INDEKS(IMPORTXML("https://finance.yahoo.com/quote/CVNA?p=CVNA";"//*[@id='quote-header-info']/div[3]/div[1]/div/span[1]");1)
我的 %Change 的 xmlImport 看起来像这样
=INDEKS(IMPORTXML("https://finance.yahoo.com/quote/CVNA?p=CVNA";"//*[@id='quote-header-info']/div[3]/div[1]/div/span[2]");1)
【问题讨论】:
-
很遗憾,我无法理解
I can get it to work with the %change, but not with the price, there I get a number I dont reconize anywhere on the page。我为此道歉。我可以问一下您期望的示例输出吗? -
我刚刚在问题中添加了屏幕截图。我希望得到一个大约 280 的数字,具体取决于速率,但得到的数字是 11.84791667
-
感谢您的回复。现在我注意到讨论已经提前了。在这种情况下,我想尊重讨论。我认为它会解决您的问题。
标签: regex xpath import google-sheets-formula yahoo-finance