Track Whatsapp
Sat Sep 09 2023 19:34:46 GMT+0000 (Coordinated Universal Time)
Saved by
@harshvasu
#javascript
function performActions() {
// First operation: click the first selector
const button1 = document.querySelector("#app > div > div > div._2QgSC > div._2Ts6i._3RGKj._318SY > span > div > span > div > div > div > div:nth-child(2) > button:nth-child(2) > span.enbbiyaj.r5qsrrlp.l7jjieqr");
if (button1) {
button1.click();
}
// Wait for 50ms
setTimeout(() => {
// Second operation: extract the innerText of the second selector
const headerElement = document.querySelector("#main > header");
if (headerElement) {
const extractedText = headerElement.innerText;
const currentTime = new Date();
const formattedTime = `${String(currentTime.getHours()).padStart(2, '0')}:${String(currentTime.getMinutes()).padStart(2, '0')}`;
console.log(`[${formattedTime}] Extracted Text:`, extractedText);
}
// Wait for another 50ms
setTimeout(() => {
// Third operation: click the third selector
const button2 = document.querySelector("#app > div > div > div._2QgSC > div._2Ts6i._3RGKj._318SY > span > div > span > div > div > div > div:nth-child(2) > button:nth-child(4)");
if (button2) {
button2.click();
}
}, 500);
}, 500);
}
// Initial call
performActions();
// Set an interval to perform these actions every 5 minutes
setInterval(performActions, 5 * 60 * 1000);
content_copyCOPY
Comments