【问题标题】:Is there a way to get a stock's financials or earnings numbers into google sheets?有没有办法将股票的财务或收益数据输入谷歌表格?
【发布时间】:2021-08-15 19:05:39
【问题描述】:

【问题讨论】:

    标签: google-sheets google-sheets-formula google-sheets-api


    【解决方案1】:

    由于页面是通过javascript构建的客户端(不是服务器端),因此需要从源代码中获取json并解析

      var source = UrlFetchApp.fetch(url).getContentText()
      var jsonString = source.match(/(?<=root.App.main = ).*(?=}}}};)/g) + '}}}}'
      var data = JSON.parse(jsonString)
    

    然后您就可以检索所有数据。

    【讨论】:

      猜你喜欢
      • 2014-08-14
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-02-16
      • 2014-05-14
      • 2021-06-06
      • 1970-01-01
      相关资源
      最近更新 更多