Created
July 26, 2018 02:44
-
-
Save oneroyalace/8395f523760e937f3444b1f258c1633b to your computer and use it in GitHub Desktop.
Outputs the name of a random movie from an imdb watchlist (runs in console)
This file contains hidden or 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
var movieList = Array(document.getElementsByClassName('lister-item-header'))[0]; | |
var randomNum = Math.floor(Math.random()*movieList.length); | |
console.log(movieList[randomNum].childNodes[0].innerText); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment