Created
July 28, 2018 15:39
-
-
Save gorka/8daf37c0d9307e2bd490438ece1001f4 to your computer and use it in GitHub Desktop.
get movies title, year & id from imdb list page
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
// get movies title, year & id from imdb list page | |
// example page: https://www.imdb.com/list/ls062489465/ | |
var movies = document.querySelectorAll('.lister-item') | |
Array.prototype.map.call(movies, movie => { | |
const title = movie.querySelector('h3 a').innerText | |
const year = movie.querySelector('.lister-item-year').innerText | |
const image = movie.querySelector('.lister-item-image') | |
const imdbId = image.dataset.tconst | |
return { | |
title, | |
year, | |
imdbId | |
} | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment