Skip to content

Instantly share code, notes, and snippets.

@funkyremi
Last active December 18, 2018 22:38
Show Gist options
  • Save funkyremi/e58b4be9fe420982ea110c4c784d2507 to your computer and use it in GitHub Desktop.
Save funkyremi/e58b4be9fe420982ea110c4c784d2507 to your computer and use it in GitHub Desktop.

Scrap Netflix Secret Categories

  1. Copy the following URL in your web browser: https://www.whats-on-netflix.com/library/categories/
  2. Copy and paste the following code in the developer console on the previous URL.
  3. The result is in your clipboard.
function simulateClick(elem) {
	const evt = new MouseEvent('click', {
		bubbles: true,
		cancelable: true,
		view: window
	});
	const canceled = !elem.dispatchEvent(evt);
};
function getPageData() {
	return Array.from(document.querySelectorAll('.dataTable>tbody>tr'))
		.map(l => ({ code: l.outerText.split('	').pop(), name: l.outerText.split('	')[0]}));
}
let result = [];
while (!document.querySelector('#devices_next').className.includes('disabled')) {
	result.push(getPageData());
	simulateClick(document.querySelector('#devices_next'));
}
result.push(getPageData());
copy(result);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment