Log in to website

Hi, I’m trying to automate logging in to app.timemoto.com

I’m a newb and I’ve been trying to work out how to do this and have cobbled together what I’ve found.

If I put my real credentials in user and pass variables I get this error

Error on line 23:40: TypeError: v.evaluateJavascript is not a function. (In ‘v.evaluateJavascript(js)’, ‘v.evaluateJavascript’ is undefined)

If I use fake values, nothing happens…just a spinning wheel.

Here’s the script…

let user = 'myuser';
let pass = 'mypass';

let v = new WebView();
await v.loadURL('https://app.timemoto.com/ClockIn/');
let js = `let user = '${user}';
let pass = '${pass}';
let inputvalid = document.getElementById('form-login-email');
if (inputvalid) {
  inputvalid.value = user;
}
document.getElementById('form-login-password').value = pass;
document.getElementById('form-login-submit').click();`;
await v.evaluateJavaScript(js);
await v.waitForLoad();
js = ""
let result = await v.evaluateJavascript(js);
await viewPromise;

D’oh! Thank you. @supermamon