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

TypeError: Cannot read properties of undefined (reading 'attribs') #6

Open
omerbengal opened this issue Jan 3, 2024 · 0 comments
Open

Comments

@omerbengal
Copy link

In Moodle.js, line 50:
"form.append("logintoken", $("[name='logintoken']")[0].attribs.value);"
I get the following error:

image

My JS code:
const { Moodle } = require("moodle-scrape");
const undici = require("undici");

const url = "https://moodle.runi.ac.il/2024/";
const username = ""; // It is an empty string but in the code the real username exists.
const password = ""; // It is an empty string but in the code the real password exists.

const moodle = new Moodle(undici.fetch, url);

async function init() {
await moodle.login(username, password);
}

init();

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

1 participant