Trend Micro Vision One Search Auto-Clicker Auto-Refresher
function clickButtonByXpath(xpathExpression) {
try {
const result = document.evaluate(xpathExpression, document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null);
const element = result.singleNodeValue;
if (element) {
element.click();
console.log(`Button found and clicked: ${xpathExpression}`);
} else {
console.warn(`Button not found for XPath: ${xpathExpression}`);
}
} catch (error) {
console.error(`Error clicking button via XPath: ${error}`);
}
}
// Define the XPath expression for your button
const buttonXpath = '//*[@id="root"]/div[2]/div/div/main/div/div/div[2]/div/div[3]/div[2]/button'; // Replace with your actual XPath
// Set an interval to call the function every 60 seconds (60000 milliseconds)
const buttonClickInterval = setInterval(() => {
clickButtonByXpath(buttonXpath);
}, 60000);
# stop the button clicking
clearInterval(buttonClickInterval);
-end