Help me to solve the problem in the script that I made to auto login on the absent work website

Hello, good evening
I ask for your help to solve the problem in my thesis that I created to log in automatically on a work absence website.

here I made a script based on JavaScript that is used in scritable applications on iOS 16.

This is the script that I made to create an automatic login on the work absence website in a scriptable app

let user = ‘ntest’;
let pass = ‘test’;

let v = new WebView();
await v.loadURL(‘https://e-absensi.rsudrsoetomo.jatimprov.go.id/absensi/public/login’);

let js = `let user = ‘${user}’;
let pass = ‘${pass}’;

document.getElementById(‘nomorindukpegawai’).value = user;
document.getElementById(‘LoginForm_password’).value = pass;
document.getElementById(‘ap-claim’).value = user;
document.getElementById(‘ap-credential-autofill-hint’).value = user;
document.getElementById(‘ap-credential-autofill-hint’).dataset.claim = user;

document.getElementById(‘login-button’).click();`;
v.present(); v.evaluateJavaScript(js);
await v.waitForLoad()

v.present(); v.evaluateJavaScript(js);
await v.waitForLoad();

const result = v.present(); v.evaluateJavaScript(js);

// use result in the Widget

in the script everything runs smoothly, but the script still can’t run the auto click command on the login button.

i use the command:

document. getElementById(‘login-button’).click();

the command does not run on the script that I made. give me a solution to complete the auto click command to make all run more perfect.

Thank You.

login page : https://e-absensi.rsudrsoetomo.jatimprov.go.id/absensi/public/login

home page after login : https://e-absensi.rsudrsoetomo.jatimprov.go.id/absensi/public/home

Try this maybe:

document. getElementById(“login-button”).click();

Hey! I am not great with JavaScript but I took the command you mentioned (document. getElementById(‘login-button’).click(); ) and ran it in the console section of my browser. It threw me a syntax error.

I looked up the click function on w3schools (HTML DOM Element click() Method) and it shows double quotes around ID. using double quotes (document. getElementById(“login-button”).click(); ) worked in the browser console. I don’t know if this could be your issue but I thought I should share what I could find.

You have a period and a rogue space separating document and getElementById. It should just be a period.

hello, thank you for helping but the script doesn’t run properly even the user and password are not filled in automatically when I change the ’ to " in document.getElementByID

hello, thank you, I’ve tried changing it and it still doesn’t work properly, even the user and password are not filled in automatically

i am attaching a video that runs the script and the result of the video i am attaching the login button is not running/no click action automaticallyProcessing: FDE55C50-F9D6-4167-9D42-154E8C9A55A2.gif…

image