stuGradesGrid not found
Opened this issue · 5 comments
Ole113 commented
When running,
scraper.scrapeReport(username, password)
.then(({ data, raw }) => {
//console.log(data) // array of reports
console.log(raw) // fetched html before parsing
});
This error occurs:
(node:7867) UnhandledPromiseRejectionWarning: Error: stuGradesGrid not found
at module.exports (/home/alex/Documents/Programming/IA Ideas/node_modules/skyward-rest/src/reportcard/condense.js:28:39)
at Object.getData (/home/alex/Documents/Programming/IA Ideas/node_modules/skyward-rest/src/reportcard/index.js:13:19)
at authenticate.then.then.response (/home/alex/Documents/Programming/IA Ideas/node_modules/skyward-rest/index.js:13:26)
at process._tickCallback (internal/process/next_tick.js:68:7)
Kaelinator commented
Did you fix the problem? If so, do you mind explaining how you fixed it?
Ole113 commented
I think the problem is that my school doesn't use the "https://skyward.cooldistrict.net/..." format, instead it uses "https://student.canyonsdistrict.org/scripts/wsisa.dll/WService=wsEAplus/fwemnu01.w". My guess is that this might be why it failed.
Is that a valid reason why it might fail?
Kaelinator commented
Hmm. Can you show me your input when you create the scraper?
Ole113 commented
const skyward = require("skyward-rest");
const url = "https://student.canyonsdistrict.org/scripts/wsisa.dll/WService=wsEAplus/fwemnu01.w";
const scraper = skyward(url);
const scrapeReport = (username, password, options) => {
scraper.scrapeReport(username, password)
.then(({ data, raw }) => {
//console.log(data)
console.log(raw);
});
}
scrapeReport(usrname, passwrd, option);
lingfeishengtian commented
A little bit late, but I feel like this has to deal with session ID, not fwemnu01.w because the REST API uses skyporthttp.w. While testing with Postman, I found session ID unnecessary and in fact, broke the API.