Skip to content

Instantly share code, notes, and snippets.

@alanmtk
Last active October 22, 2021 14:19
Show Gist options
  • Save alanmtk/7122e1bea454f575b86083e477f3b731 to your computer and use it in GitHub Desktop.
Save alanmtk/7122e1bea454f575b86083e477f3b731 to your computer and use it in GitHub Desktop.
We have all suffered trying to get to a specific page in cryptomines marketplace. This code will take you to whatever page you want.
function goToLastPage() {
const links = [...document.querySelectorAll('.pagination li a')];
links[links.length - 2].click();
}
function goTo(page) {
const labels = [...document.querySelectorAll('.pagination a')].map(n => n.text);
if(!labels.includes(`${page}`)) {
document.querySelector('.previousBttn').click();
setTimeout(() => { goTo(page) }, 1000);
}
}
function start(page) {
goToLastPage();
goTo(page - 1);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment