Skip to content

Instantly share code, notes, and snippets.

@gorka
Created July 28, 2018 15:39
Show Gist options
  • Save gorka/8daf37c0d9307e2bd490438ece1001f4 to your computer and use it in GitHub Desktop.
Save gorka/8daf37c0d9307e2bd490438ece1001f4 to your computer and use it in GitHub Desktop.
get movies title, year & id from imdb list page
// 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