Created
June 29, 2020 01:25
-
-
Save 7rulnik/10db59afb0124e63d92288fa71a9cb43 to your computer and use it in GitHub Desktop.
get-ps4-games.js
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
// works only for russian language but you can change arguments in meta.includes | |
// Open https://store.playstation.com/ru-ru/download/list and run script below | |
let games = []; | |
while ( | |
!document | |
.querySelector('.paginator-control__page-number--selected') | |
.nextElementSibling.classList.contains('paginator-control__arrow-navigation') | |
) { | |
let items = document.querySelectorAll('.download-list-item'); | |
for (const item of items) { | |
const link = item.querySelector('.download-list-item__title'); | |
const { href } = link; | |
const name = link.innerText.trim(); | |
const meta = item.querySelector('.download-list-item__metadata').innerText; | |
const isGame = meta.includes('Игра'); | |
const isDlc = meta.includes('Дополнение'); | |
const [, , buyDate] = meta.split(' | '); | |
const platforms = [ | |
...item.querySelectorAll('.download-list-item__playable-platforms') | |
].map(item => item.innerText.trim()); | |
games.push({ | |
href, | |
name, | |
isGame, | |
isDlc, | |
buyDate, | |
platforms | |
}); | |
} | |
document.querySelector('.paginator-control__page-number--selected').nextElementSibling.click(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment