Skip to content

Instantly share code, notes, and snippets.

@7rulnik
Created June 29, 2020 01:25
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save 7rulnik/10db59afb0124e63d92288fa71a9cb43 to your computer and use it in GitHub Desktop.
Save 7rulnik/10db59afb0124e63d92288fa71a9cb43 to your computer and use it in GitHub Desktop.
get-ps4-games.js
// 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