在编程方面,我是一个绝对的初学者。我一直在尝试将数据表从“http://www.rotowire.com/daily/nba/value-report.htm”导入到谷歌电子表格中。
我遇到了Google Apps Scripts和urlfetchapp基本身份验证,并尝试创建并运行脚本,但我无法弄明白。这是我尝试用于基本身份验证的代码([见过这里] [1]):
function myTest() {
var USERNAME = PropertiesService.getScriptProperties().getProperty('johndoe22);
var PASSWORD = PropertiesService.getScriptProperties().getProperty('doejohn11');
var url = PropertiesService.getScriptProperties().getProperty('http://www.rotowire.com/daily/nba/value-report.htm');
}
运行此脚本时没有任何反应,我做错了什么?我只需要脚本就可以从该网站获取信息。
感谢您的帮助。
答案 0 :(得分:1)
如果您只是尝试从该网站导入该表格,那么您就不需要Google Apps脚本 - 您可以使用内置的电子表格功能&#34; IMPORTHTML&#34; < / p>
=IMPORTHTML("http://www.rotowire.com/daily/nba/value-report.htm","table","1")
您可以在Google spreadsheet function list中详细了解该功能。我用can view制作了一个电子表格。