Created
August 19, 2023 21:29
-
-
Save NZDev0/c24050f929617e88a5047f0f8baac848 to your computer and use it in GitHub Desktop.
Game HTML list scrapers for GoG, Steam, Epic
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
// Not sure if Steam will give you multiple pages as my collection isn't large enough to warrant multiple pages | |
/* | |
* Run on the following page https://steamcommunity.com/id/USERNAME/games/?tab=all | |
*/ | |
var game_list = document.querySelectorAll('[class^="gameslistitems_GameNameContainer_"] > a'); | |
var games = Array.from(game_list, game => game.innerHTML).sort(); | |
console.log(games); | |
// You will have to run on all game pages, pending how large your collection is | |
/* | |
* Run on the following page https://www.gog.com/en/account | |
*/ | |
var game_list = document.querySelectorAll('.product-row-wrapper .product-title__text'); | |
var games = Array.from(game_list, game => game.innerHTML); | |
console.log(games); | |
// The jss{NUM} will change for you | |
/* | |
* Run on the following page https://www.epicgames.com/account/connections | |
*/ | |
var x = setInterval(() => { | |
if(document.querySelector('.MuiBox-root.jss{NUM} > button')){ | |
document.querySelector('.MuiBox-root.jss{NUM} > button').click(); | |
}else{ | |
clearInterval(x); | |
} | |
}, 10 * 1000); | |
// Once button has disappeared, then run the following | |
var game_list = document.querySelectorAll('.MuiAccordion-root h3'); | |
var games = Array.from(game_list, game => game.innerHTML).sort(); | |
console.log(games); | |
// The above doesn't have all the games, so you need to run the following to get some of the same games + new ones | |
// Also work in progress as Epic hasn't been the easiest to scrape | |
// The jss{NUM} is different than the above number | |
/* | |
* Run on the following page https://www.epicgames.com/account/transactions?lang=en&productName=epicgames | |
*/ | |
var x = setInterval(() => { | |
if(document.querySelector('.MuiBox-root.jss{NUM} > button')){ | |
document.querySelector('.MuiBox-root.jss{NUM} > button').click(); | |
}else{ | |
clearInterval(x); | |
} | |
}, 5 * 1000); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment