Last active
October 17, 2020 16:45
-
-
Save geoffreyhale/c14ce8918d0a494cac20550b89c36f3f to your computer and use it in GitHub Desktop.
Scrape My Netflix Ratings (JavaScript)
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
// 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