As the title says I need to create a bookmarklet in javascript that keeps refreshing a page and checks if a div is present on that page. Using the snippet of the code below the page is refreshing but when I log the div it is always undefined even if the div with the class container is present. How to do it?
document.write(`<frameset><frame src="${location.href}"></frameset>`);
setInterval(() => {
console.log(document.getElementsByClassName("container")[0].innerText);
document.getElementsByTagName('frame')[0].src += ''
},
5000);