0

My code:

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);

I read through a few posts like this one but still having trouble getting the data I need. The result is HTML from the redirected login page. Is it possible this site uses a different Authorization type or do I need to pass something else in the header?

ankitkanojia
  • 3,072
  • 4
  • 22
  • 35
shenn
  • 859
  • 4
  • 17
  • 47
  • When you contacted the site about programmatic access to their data, what did they say? If anyone knows how to authorize, it would be the actual website team.. – tehhowch Sep 06 '18 at 14:05
  • I didn't contact them yet but I will if needed. – shenn Sep 06 '18 at 14:25
  • http`s` The site doesn't use basic authentication. Only old http sites use the authentication you're trying. – TheMaster Sep 06 '18 at 15:57
  • Which should I try... – shenn Sep 06 '18 at 16:38
  • Depends.... Do they provide api access? If so, Its straight from the api documentation. If not, I'm not sure ... It maybe oAuth 2, which means you might need to send a ``Bearer: access token``.... It's better to just contact them... – TheMaster Sep 06 '18 at 20:50

0 Answers0