Skip to content

Instantly share code, notes, and snippets.

@osvalr
Created December 14, 2025 01:15
Show Gist options
  • Select an option

  • Save osvalr/10b804ab638d4464d6a2f76b0eb009e0 to your computer and use it in GitHub Desktop.

Select an option

Save osvalr/10b804ab638d4464d6a2f76b0eb009e0 to your computer and use it in GitHub Desktop.
get all image urls for a collegium album
function deepQueryAll(selector, node = document) {
const out = [];
const walk = (n) => {
out.push(...n.querySelectorAll?.(selector) ?? []);
n.querySelectorAll?.("*")?.forEach(el => el.shadowRoot && walk(el.shadowRoot));
};
walk(node);
return out;
}
deepQueryAll("img").map(i => i.src).filter((i) => i.includes("https://goschoolar.s3.amazonaws.com/uploads"));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment