Skip to content

Instantly share code, notes, and snippets.

@geoffreyhale
Last active October 17, 2020 16:45
Show Gist options
  • Save geoffreyhale/c14ce8918d0a494cac20550b89c36f3f to your computer and use it in GitHub Desktop.
Save geoffreyhale/c14ce8918d0a494cac20550b89c36f3f to your computer and use it in GitHub Desktop.
Scrape My Netflix Ratings (JavaScript)
// Adapted from original source: https://martymcgui.re/2018/05/04/leaving-netflix-and-taking-my-data-with-me/
/**
* Navigate to Netflix Ratings view page:
* Netflix > Account (from avatar dropdown in top right of screen) > Ratings (from profile of your choice) View
*
* or also works on Viewing activity > Ratings page:
* Netflix > Account (from avatar dropdown in top right of screen) > Viewing activity (from profile of your choice) View > Rating
*/
ratings = []; // removed const for ease of use in console
document.querySelectorAll('li.retableRow')
.forEach((row)=>{
ratings.push({
date: row.querySelector('.date').innerText,
title: row.querySelector('.title a').innerText,
url: row.querySelector('.title a').getAttribute('href'),
thumbRating: !!row.querySelector('[*|href="#thumb-up-filled"]'),
starRating: row.querySelectorAll('.rating .star.personal').length
});
});
console.log(ratings);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment