I want to use puppeteer to login faster and i made this script, but it recognize the variable of the input as a variable of the site
let data = {
email : 'mail',
password : 'passwd'
}
async function login(data) {
page.evaluate(() => {
document.querySelector('#loginlb > div.c-loginlb__popup > div > form > div:nth-child(1) > input').value = data.email;
});
}
The error is this: Evaluation failed: TypeError: Cannot read property 'email' of undefined
How can i fix that?