【发布时间】:2021-07-05 10:17:13
【问题描述】:
我希望将一些文件保存到我的 Google Drive。但是UrlFetchApp.fetch 不会得到任何响应并且会超时。我怎么知道这里出了什么问题?
var url = 'https://www.cmegroup.com/CmeWS/exp/voiProductsViewExport.ctl?media=xls&tradeDate=20210702&assetClassId=2&reportType=F&excluded=CEE,CEU,KCB';
var response = UrlFetchApp.fetch(url);
Logger.log(response.getResponseCode())
var folder = DriveApp.getFolderById(folderID); // omitting folderID in this snippet
var file = folder.createFile(response.getBlob());
file.setName('file.xls');
【问题讨论】:
-
@Argyll 你是怎么做到的?
-
@iansedano:还在思考。我可能会在您的答案中使用该工具和本地触发的脚本在浏览器中打开/关闭它。还想知道是否有其他人发现 CME 的网站有所不同。
标签: google-apps-script urlfetch