0
我正在尝试使Google床单应用程序脚本适用于我正在使用的IMPORTXML。将IMPORTXML添加到自动更新的Google Apps脚本
A1
=importxml("http://www.nfl.com/liveupdate/scorestrip/ss.xml","//@q")
A2
=importxml("http://www.nfl.com/liveupdate/scorestrip/ss.xml","//@h")
数据从A1:B16
填充根据剧本我在网上发现有它自动刷新:
function getData() {
var queryString = Math.random();
var cellFunction1 = '=IMPORTXML("' + SpreadsheetApp.getActiveSheet().getRange('A1').getValue() + '?' + queryString + '","'+ SpreadsheetApp.getActiveSheet().getRange('A2').getValue() + '")';
SpreadsheetApp.getActiveSheet().getRange('C1').setValue(cellFunction1);
var cellFunction2 = '=IMPORTXML("' + SpreadsheetApp.getActiveSheet().getRange('A4').getValue() + '?' + queryString + '","'+ SpreadsheetApp.getActiveSheet().getRange('A5').getValue() + '")';
SpreadsheetApp.getActiveSheet().getRange('C2').setValue(cellFunction2);
}
我不知道我应该是把/用我的代码代替。如果有人能够帮助我解释我应该改变什么来让它在我的工作表中发挥作用/提供一些示例,说明如何看待这将是一个巨大的帮助。
我很欣赏
[定期刷新IMPORTXML()电子表格函数](https://stackoverflow.com/questions/33872967/periodically-refresh-importxml-spreadsheet-function)可能的副本 –