Say I have a website with the following pages:
page1.html, page2.html, page3.html
for each one of these pages, load the page, and get the console logs.
Use iframe and load your next html files changing .src
with onload
event. The console.log
s from each html file will be shown in your console.
var iframe = document.getElementById('iframe');
var iter = 0;
var myLinks = ['page1.html','page2.html','page3.html']; //replace with your correct existing urls
iframe.src = myLinks[0];
iframe.onload = function(){
iter++;
if(iter===myLinks.length) return;
iframe.src = myLinks[iter];
};
<iframe id="iframe" src=""></iframe>