Saturday, 1 April 2017

Exceeding max redirects when attempting to scrape a webpage?

I'm attempting to scrape a webpage in Node.js.

var request = require('request').defaults({maxRedirects:3});

var propertiesObject = { k:'81684', t:'2177', e:"all", hon:"F", promod:"F" };

let url = "https://webapp4.asu.edu/catalog/classlist?k=81684&t=2177&e=all&hon=F&promod=F"
// , qs:propertiesObject
request({url:url, qs:propertiesObject}, function(err, response, body) {
  if(err) { console.log(err); return; }
  console.log("Get response: " + response.statusCode);
});

I'm getting max number of redirects for some reason. I can do a get request in postman and I can visit the page just fine. What would I do to cause redirects to happen?



via Ryan Shocker

No comments:

Post a Comment