Created
December 22, 2021 20:25
-
-
Save dmitriy1980/43e6a94be4c5a8b0b045acf72b016039 to your computer and use it in GitHub Desktop.
Export "My List" from Netflix to CSV
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
(function() { | |
var lineArray = []; | |
document.querySelectorAll('.title-card a[aria-label]').forEach( | |
function(item, index) { | |
try { | |
var line = item.getAttribute('aria-label').replace(/,/g, '') + "," + "https://www.netflix.com" + item.getAttribute("href").split("?")[0] | |
lineArray.push(index == 0 ? "data:text/csv;charset=utf-8," + line : line); | |
} catch (err) { | |
console.err("ERROR: Ignored err", err, item) | |
} | |
}) | |
var csvContent = lineArray.join("\n"); | |
data = encodeURI(csvContent); | |
link = document.createElement('a'); | |
link.setAttribute('href', data); | |
link.setAttribute('download', 'export.csv'); | |
link.click(); | |
}()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment