我可以在Google表格中使用importthtml从Yahoo Finance检索财务数据,但是缺少Google Finance拥有数据的地方。例如,这里有一个链接到福特在谷歌财务上的财务数据,我如何在谷歌表格中使用importthtml获取这些数据?
https://www.google.com/finance?q=NYSE%3AF& fstype = ii& ei = viASWOnfNsfEeqqUnMgG
这完全取决于你想要什么。这些语句获取所有可用的表:
损益表季度数据
=importhtml(
"https://www.google.com/finance? q=NYSE%3AF&fstype=ii&ei=viASWOnfNsfEeqqUnMgG","table",2)
损益表年度数据
=importhtml(
"https://www.google.com/finance?q=NYSE%3AF&fstype=ii&ei=viASWOnfNsfEeqqUnMgG","table",3)
资产负债表季度数据
=importhtml(
"https://www.google.com/finance?q=NYSE%3AF&fstype=ii&ei=viASWOnfNsfEeqqUnMgG","table",4)
资产负债表年度数据
=importhtml(
"https://www.google.com/finance?q=NYSE%3AF&fstype=ii&ei=viASWOnfNsfEeqqUnMgG","table",5)
现金流量季度数据
=importhtml(
"https://www.google.com/finance?q=NYSE%3AF&fstype=ii&ei=viASWOnfNsfEeqqUnMgG","table",6)
现金流量年度数据
=importhtml(
"https://www.google.com/finance?q=NYSE%3AF&fstype=ii&ei=viASWOnfNsfEeqqUnMgG","table",7)
要获取其他公司,请输入股票代码(即;F, GOOG, IBM)中的单元格,并在URL中引用该单元格。这样的:
=importhtml(
"https://www.google.com/finance?q="&A2&"&fstype=ii&ei=viASWOnfNsfEeqqUnMgG","table",2)
"&A2&"引用单元格A2。该公式将获取单元格A2中公司的数据。