Created
March 16, 2019 22:26
-
-
Save maxwofford/bbbf9cff4bd1d1aac5995a0314e83b2e to your computer and use it in GitHub Desktop.
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
last_page = false | |
usernames = [] | |
function nextPage(lastPage=false) { | |
newUsernames = Array.from(document.querySelectorAll('.user-list-item>div>div>a')).map(a => a.innerText) | |
usernames = usernames.concat(newUsernames) | |
lastPage = document.querySelector('.next_page').className.split(' ').indexOf('disabled') != -1 | |
if(!lastPage) { | |
setTimeout(() => { | |
document.querySelector('.next_page').click() | |
setTimeout(nextPage, 3000) | |
}, 1000) | |
} else { | |
window.localStorage.setItem('usernameArray', JSON.stringify(usernames)) | |
} | |
} | |
nextPage() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment