Skip to content

Instantly share code, notes, and snippets.

@jozsefs
Last active September 30, 2022 17:57
Show Gist options
  • Save jozsefs/d88db2d5db88934c2245b7130cb6dcfc to your computer and use it in GitHub Desktop.
Save jozsefs/d88db2d5db88934c2245b7130cb6dcfc to your computer and use it in GitHub Desktop.
Get imdb episodes score
// 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