Google 电子表格导入 HTML table

Google Spreadsheet ImportHTML table

我想从这个网站导入 table:

https://www.arcgis.com/home/item.html?id=917fc37a709542548cc3be077a786c17#data

在此电子表格中:

https://docs.google.com/spreadsheets/d/13bfnQP_kgFsB7k3F_6xMxkMI4wW7ukI9TVq-aVZ3TzE/edit#gid=0

并使用了这个功能

=IMPORTHTML("https://www.arcgis.com/home/item.html?id=917fc37a709542548cc3be077a786c17#data", "table", 1)

答案是"Imported content is empty"。我还需要做什么?

您尝试抓取的网站受 JavaScript 控制。 Google Sheets 无法导入 JS 元素。您可以简单地通过禁用给定站点的 JavaScript 来测试这一点,并且可以抓取您剩下的内容。在你的情况下:没有:

备用选项。使用自定义脚本直接加载 JSON 数据。

使用 GoogleSheets 导入 JSON 数据的脚本(致谢 Paul Gambill): https://gist.github.com/paulgambill/cacd19da95a1421d3164

和数据:

https://services7.arcgis.com/mOBPykOjAyBO2ZKk/arcgis/rest/services/RKI_Landkreisdaten/FeatureServer/0/query?f=json&where=1=1&returnGeometry=false&spatialRel=esriSpatialRelIntersects&outFields=*&orderByFields=OBJECTID%20ASC&resultOffset=0&resultRecordCount=412

输出: