Created
June 30, 2019 15:35
-
-
Save HenriqueSilverio/7dd6b670845773d2f8db98ab9cd1fe08 to your computer and use it in GitHub Desktop.
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
(() => { | |
const tracksSelector = '.tracklist-row' | |
const $tracks = Array.from(document.querySelectorAll(tracksSelector)) | |
const tracks = $tracks.reduce((result, track) => { | |
const { name, artist } = { | |
name: track.querySelector('.tracklist-name').innerText.trim(), | |
artist: track.querySelector('.tracklist-row__artist-name-link').innerText.trim() | |
} | |
return `${result}\n${name} - ${artist}` | |
}, '') | |
console.log(tracks) | |
})() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment