我在Google應用程序腳本中使用Spreadsheet Services從Internet檢索一些數據,然後用它混亂一點。問題是,當我設置的IMPORTHTML值,如果數據集大於說我沒有訪問權客場進口範圍內的幾行,因此錯誤是在腳本拋出:當通過HTML導入電子表格中的數據時,應用腳本訪問數據導入
例如:
// create tmp sheet and import some data.
var sheet = this.createTmpSheet(); // custom method to create a temp sheet.
sheet.getRange('A1').setValue('=ImportHtml("someUrl","table",1)');
// at this point usually I can access the range
var range_to_copy = sheet.getDataRange();
// However if the data is more than 10-15 rows I get invalid dimention for range..
任何想法如何等待導入的「準備就緒」?沒有一個通用觸發器看起來像是一個合適的選擇。我需要的只是流程控制,以便在導入完成後通知,通常在10秒以內。