let user = 'cvbhh';
let pass = 'tyujhh';
console.log("Script dimulai...");
let v = new WebView();
await v.loadURL('https://e-absensi.rsudrsoetomo.jatimprov.go.id/');
let js = `
let user = '${user}';
let pass = '${pass}';
document.getElementById('nomorindukpegawai').value = user;
document.getElementById('LoginForm_password').value = pass;
document.getElementById('login-button').click();
`;
v.present();
v.evaluateJavaScript(js);
await v.waitForLoad();
console.log("Script selesai.");
Help me create an automated click on the above script to enable automatic login along with automatic clicks at specified times.
This is the HTML code that I will execute for automatic clicking.
<div class="sidebar-user-info">
<div class="sui-normal">
<a class="user-link">
<img src="https://e-absensi.rsudrsoetomo.jatimprov.go.id/absensi/public/data/images/pegawai/Avatar.png" width="55x" alt="" class="img-circle">
<span style="font-size:18px;"><b>Selamat Datang</b></span>
<strong style="font-size:10px;">Syarif Hidayat<br>153515182112980001<br></strong>
</a>
</div>
<!--<div style="font-size:10px;" class="sui-hover inline-links animate-in">
<span class="close-sui-popup">×</span>
</div>-->
</div>
<div id="generateMenu">
<ul class="main-menu" id="main-menu">
<li class="root-level">
<a class="nav-link" href="https://e-absensi.rsudrsoetomo.jatimprov.go.id/absensi/public/home">
<i class="fa fa-home" style="width: 20px" aria-hidden="true"></i>
<span>Absen</span>
</a>
</li>
<li class="root-level">
<a class="nav-link" href="https://e-absensi.rsudrsoetomo.jatimprov.go.id/absensi/public/absensi/absen_saya">
<i class="entypo-doc-text" style="width: 20px" aria-hidden="true"></i>
<span>Rekap Absen Saya</span>
</a>
</li>
<li class="root-level">
<a class="nav-link" href="https://e-absensi.rsudrsoetomo.jatimprov.go.id/absensi/public/presensisaya">
<i class="entypo-book" style="width: 20px" aria-hidden="true"></i>
<span>Laporan Presensi Saya</span>
</a>
</li>
<li class="root-level">
<a class="nav-link" href="https://e-absensi.rsudrsoetomo.jatimprov.go.id/absensi/public/shift/shift_saya">
<i class="entypo-switch" style="width: 20px" aria-hidden="true"></i>
<span>Shift Saya</span>
</a>
</li>
<li class="root-level">
<a class="nav-link" href="https://e-absensi.rsudrsoetomo.jatimprov.go.id/absensi/public/user/ubah_password">
<i class="entypo-key" style="width: 20px" aria-hidden="true"></i>
<span>Ubah Password</span>
</a>
</li>
<hr>
<li class="root-level">
<a class="nav-link" href="https://e-absensi.rsudrsoetomo.jatimprov.go.id/absensi/public/logout" onclick="event.preventDefault(); document.getElementById('logout-form').submit();">
<i class="fa fa-sign-out" aria-hidden="true"></i>
<span>Sign-Out</span>
</a>
<form id="logout-form" action="https://e-absensi.rsudrsoetomo.jatimprov.go.id/absensi/public/logout" method="POST" style="display: none;">
<input type="hidden" name="_token" value="q2xKIYBzCy9o8SLgOsHIVy3E5jgbBMM3G0Vw6IhQ"> </form>
</li>
</ul>
</div>
</div>
<div class="main-content">
<div class="row">
<div class="col-md-6 col-sm-8 clearfix">
</div>
<div class="col-md-6 col-sm-4 clearfix hidden-xs">
<ul class="list-inline links-list pull-right">
<li class="sep"></li>
</ul>
</div>
</div>
<hr>
<div class="panel panel-gradient">
<div class="panel-heading">
<div class="panel-title">Dashboard User</div>
</div>
<div class="panel-body">
<!--CONTENTS HERE-->
<!--PUT THE CONTENT HERE-->
<div class="ajax-loader">
<img src="https://e-absensi.rsudrsoetomo.jatimprov.go.id/absensi/public/images/ajax-loader.gif" class="img-responsive">
</div>
<button class="btn info tombol" onclick="absenmasuk()">ABSEN MASUK</button>
<button class="btn info tombol" onclick="absenpulang()">ABSEN PULANG</button>
<div class="panel-body">
<!--
<div class="row">
<div class="col-md-5 col-xs-12" style="text-align: center;margin: auto; border: 1px dashed red;height: 100%">
<h2>Webcam</h2>
<div id="my_camera" style="text-align: center; margin: auto;"></div>
I have attached a screenshot of the above code.
screenshoot dashboard
I did not provide the complete HTML code above because it is too lengthy and complex.
Please assist me in resolving this issue. What I want is, after logging in and being on the page to perform clock-in or clock-out, I would like to create a script that automatically clicks the clock-in button when the time is between 6-7 AM. Similarly, for clock-out, it should automatically run when the time is between 2-3 PM.
I would recommend you remove your User ID and Password from the example code you’ve posted.
How can Mr. @jayelevy make an automated click code for that script?
rob
June 11, 2023, 11:16am
7
Note that they are still visible in the history.
Please change your password (it’s way too weak anyway).