Increment Page number and Append
javascript:(function() {
var maxPage = parseInt(prompt('Enter the maximum page number'));
if (isNaN(maxPage)) {
alert('Invalid number');
return;
}
var currentPage = parseInt(location.href.match(/page=(\d+)/)[1]);
var nextPage = currentPage + 1;
var baseUrl = location.href.replace(/page=\d+/, 'page=');
var body = document.body;
while (nextPage <= maxPage) {
fetch(baseUrl + nextPage)
.then(response => response.text())
.then(data => {
var parser = new DOMParser();
var doc = parser.parseFromString(data, 'text/html');
body.appendChild(doc.body);
})
.catch(error => console.error('Error:', error));
nextPage++;
}
})();