Last active
October 22, 2021 14:19
-
-
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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