Skip to content

Instantly share code, notes, and snippets.

@hkamran80
Created December 13, 2022 03:13
Show Gist options
  • Save hkamran80/2d94d56ce4c1fef31c6043fd1d103ea4 to your computer and use it in GitHub Desktop.
Save hkamran80/2d94d56ce4c1fef31c6043fd1d103ea4 to your computer and use it in GitHub Desktop.
Utilities
// Get all names on a Canvas roster from [Course] > People
// With filtering
console.log([...document.querySelectorAll("tbody tr.rosterUser")].filter(row => row.querySelector("td[data-test-id=section-column-cell]").textContent.includes("[your filter]")).map(row => row.querySelector("td:nth-child(2)").textContent.trim()).join("\n"));
// Without filtering
console.log([...document.querySelectorAll("tbody tr.rosterUser")].map(row => row.querySelector("td:nth-child(2)").textContent.trim()).join("\n"));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment