【发布时间】:2018-04-20 18:15:58
【问题描述】:
我想将 HTML 页面中的表格数量返回到 Google 表格。下面的代码可以让我知道 chrome 控制台中的表格数量。
var i = 1; [].forEach.call(document.getElementsByTagName("table"),
function(x) { (i++, x); });
console.log (i)
但我不知道如何在 Google App Script 中获得此结果 (i),因此我可以将其返回到我的工作表中。有点像
function doGet() {
var html = UrlFetchApp.fetch('http://allqs.saqa.org.za/showUnitStandard.php?id=7743').getContentText();
var table = getElementsByClassName(html, 'table')[0];
var i = 1; [].forEach.call(document.getElementsByTagName("table"),
(i++, x);
console.log (i)
【问题讨论】:
标签: html google-apps-script google-sheets