Google App脚本:UrlFetchApp.Fetch()上的身份验证失败

时间:2018-09-06 13:50:35

标签: javascript google-apps-script urlfetch

我的代码:

var username = "";
var password = "";
var options = {};
options.headers = {
  "Authorization": "Basic " + Utilities.base64Encode(username + ":" + password)
};
var html = UrlFetchApp.fetch("https://www.4for4.com/fantasy-football/full-impact/cheatsheet/Flex/38351/ff_nflstats/adp_blend", options).getContentText();
Logger.log(html);

我通读了this one之类的几篇文章,但仍然无法获取所需的数据。结果是重定向的登录页面中的html。该网站是否可能使用其他授权类型,或者我是否需要在标题中传递其他内容?

0 个答案:

没有答案