Created
December 1, 2021 10:01
-
-
Save mcmonkey4eva/dfebb2e479b7d448082a52f84f3b5ddd to your computer and use it in GitHub Desktop.
javascript code to scrape mee6's data for a guild from the leaderboard page
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
// Toss this into browser console after loading all guild data locally. It's a mess, yaehp. | |
var out = ""; | |
Array.prototype.forEach.call(document.getElementsByClassName('leaderboardPlayersList')[0].children[0].children, function(elem) { | |
console.log("try " + elem.textContent); | |
var userData = elem.children[0].children[0]; | |
var statData = elem.children[0].children[1]; | |
var avatarData = userData.children[1].children[0].src; | |
var nameData = userData.children[2].textContent.replaceAll('`', '_'); | |
var xpData = statData.children[1].children[1].textContent; | |
var levelData = statData.children[2].children[0].children[1].textContent; | |
var fillData = statData.children[2].className; | |
out += "`" + avatarData + "`, `" + nameData + "`, `" + xpData + "`, `" + levelData + "`, `" + fillData + "`\n"; | |
}); | |
out |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment