【发布时间】:2021-12-05 15:23:09
【问题描述】:
我正在尝试将加密数据导入 Google 表格。在 Apps Script 中出现以下错误:
Exception: Attribute provided with no value: url
ImportJSONAdvanced @ ImportJSON.gs:168
ImportJSON @ ImportJSON.gs:63
当我尝试使用这个公式在工作表中显示数据时:
=importJSON("https://api.coingecko.com/api/v3/coins/markets?vs_currency=eur&ids=bitcoin")
我收到错误“#NAME?”
谁能帮我解决这个问题?
这里有 2 个导致错误的 sn-ps:
function ImportJSONAdvanced(url, fetchOptions, query, parseOptions, includeFunc, transformFunc) {
var jsondata = UrlFetchApp.fetch(url, fetchOptions); *<--- ERROR OCCOURS HERE
var muteHttpExceptions = true;
var object = JSON.parse(jsondata.getContentText());
return parseJSONObject_(object, query, parseOptions, includeFunc, transformFunc);
}
function ImportJSON(url, query, parseOptions) {
return ImportJSONAdvanced(url, null, query, parseOptions, includeXPath_, defaultTransform_); // *<--- ERROR OCCOURS HERE
}
【问题讨论】:
标签: json google-sheets google-sheets-formula google-sheets-api