Created
March 22, 2018 13:53
-
-
Save pedroxs/afff0e5acec682c3b50662c124dfbee3 to your computer and use it in GitHub Desktop.
Creates a list of game names and size from Humble Bundle library
This file contains hidden or 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
// $('div.column.subproducts-holder.js-subproducts-holder').children().slice(0, 5).each(function (i, it) { | |
$('div.column.subproducts-holder.js-subproducts-holder').children().each(function (i, it) { | |
let $it = $(it); | |
$it.click(); | |
let gName = $it.find('h2').text(); | |
while ($(`div.details-heading:contains("${gName}")`) < 1) { | |
console.log('wait'); | |
} | |
let $div = $('div.js-download-button.download-button:visible'); | |
let $games = $div.find(':contains("Download")') || $div.find(':contains("Mobile")') || $div.find(':contains("New")') || $div.find(':contains("Web Installer")'); | |
$games.each(function (i, game) { | |
let $game = $(game).closest('div'); | |
console.log($game.find('span').text().trim() + ' | ' + $game.find('div').text().trim().replace(/(\s+|\n)/g, ' ')); | |
}); | |
}); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment