Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

stuGradesGrid not found #24

Open
Ole113 opened this issue Aug 9, 2019 · 5 comments
Open

stuGradesGrid not found #24

Ole113 opened this issue Aug 9, 2019 · 5 comments

Comments

@Ole113
Copy link

Ole113 commented Aug 9, 2019

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)
@Ole113 Ole113 closed this as completed Aug 9, 2019
@Kaelinator
Copy link
Owner

Did you fix the problem? If so, do you mind explaining how you fixed it?

@Ole113
Copy link
Author

Ole113 commented Aug 9, 2019

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?

@Ole113 Ole113 reopened this Aug 12, 2019
@Kaelinator
Copy link
Owner

Hmm. Can you show me your input when you create the scraper?

@Ole113
Copy link
Author

Ole113 commented Aug 12, 2019

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
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants