Skip to content

Instantly share code, notes, and snippets.

@ggauravr
Last active February 21, 2016 21:21
Show Gist options
  • Save ggauravr/6bb43798db076b746011 to your computer and use it in GitHub Desktop.
Save ggauravr/6bb43798db076b746011 to your computer and use it in GitHub Desktop.
A list of top 100 grossers of 2015
var titleLinks = document.querySelectorAll('table a[href^="/movies/?id"]'),
titleArray = Array.prototype.slice.call(titleLinks),
titles = titleArray.map(function(link) {
return link.innerText + '@' + link.href;
});
// titles is an array like this:
// ["Star Wars: The Force Awakens@http://www.boxofficemojo.com/movies/?id=starwars7.htm",
// "Jurassic World@http://www.boxofficemojo.com/movies/?id=jurassicpark4.htm",
// "Avengers: Age of Ultron@http://www.boxofficemojo.com/movies/?id=avengers2.htm",
// ...
// ]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment