'Google Apps Script basic authentication

I'm an absolute beginner when it comes to programming. I've been trying to import data table from "http://www.rotowire.com/daily/nba/value-report.htm" into google spreadsheets.

I came across Google Apps Scripts and urlfetchapp basic authentication and tried to create and run a script but I can't figure it out. This is the code I tried using to for the basic authentication ([came across here][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');
}

Nothing happens when I run this script, what am I doing wrong? I just need the script to be able to pull info from that website.

Thanks for all your help.



Solution 1:[1]

If you're just trying to import the table from that website, you don't need Google Apps Scripts - you can do that with the built in spreadsheet function "IMPORTHTML":

=IMPORTHTML("http://www.rotowire.com/daily/nba/value-report.htm","table","1")

You can read more about the function in the Google spreadsheet function list. I made a spreadsheet using this that you can view.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Jens Astrup