Last active
September 30, 2022 17:57
-
-
Save jozsefs/d88db2d5db88934c2245b7130cb6dcfc to your computer and use it in GitHub Desktop.
Get imdb episodes score
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
// house of the dragon (use it on imdb.com from console) | |
fetch('https://www.imdb.com/title/tt11198330/episodes?season=1').then(r => r.text()).then(text => { | |
const html = document.createRange().createContextualFragment(text); | |
const episodes = [...html.querySelectorAll('.ipl-rating-star.small .ipl-rating-star__rating')].map((node, ep) => ({ep: ep + 1, rating: +node.innerHTML})); | |
console.log(JSON.stringify(episodes, null, 2)); | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment