I have a code that i want to put in chrome console
var a = document.getElementsByClassName("dispo");
if (a.length > 0) {
for (let i = 0; i < a.length ; i++) {
if (a[i].textContent.length > 0) {
console.log(a[i].parentElement.textContent.substr(0,10) + " - " + a[i].textContent);
}
}
} else {
setInterval(function(){ document.location.reload() },60000);
}
The function above gets some data from the website, but if it didn't find the data i want it to reload every minute until the data is available.
I want to insert the code only once and leave the browser working.
So how to run the function every time i reload the page ?