These rudiments still seem to work, the rest perhaps a good exercise for the reader ?
Google result count.kmmacros (3.4 KB)
Or, of course, combining the click with the value reading:
Expand disclosure triangle to view JS source
const toolsButton = document.getElementById("hdtb-tls");
return (
"false" === toolsButton.getAttribute("aria-expanded") && (
toolsButton.click()
),
document.getElementById("result-stats").textContent
);
