Skip to content

Instantly share code, notes, and snippets.

@nt1m
Created October 31, 2019 20:00
Show Gist options
  • Save nt1m/3c686a52c7995d46953c34f5204816ac to your computer and use it in GitHub Desktop.
Save nt1m/3c686a52c7995d46953c34f5204816ac to your computer and use it in GitHub Desktop.
Scrapes criterion.com
copy([...$$("#gridview .gridFilm")].map(x => {
let comma = x.querySelector(".g-country__comma");
if (comma && getComputedStyle(comma).display == "none") {
comma.remove();
}
return {
spine: x.querySelector(".g-spine").textContent.trim(),
img: x.querySelector(".g-img > img").src.trim(),
title: x.querySelector(".g-title").textContent.trim(),
href: x.querySelector(".g-title > a").href.trim(),
director: x.querySelector(".g-director").textContent.trim(),
country: x.querySelector(".g-country").textContent.trim(),
year: x.querySelector(".g-year").textContent.trim()
};
}));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment