Created
December 13, 2022 03:13
-
-
Save hkamran80/2d94d56ce4c1fef31c6043fd1d103ea4 to your computer and use it in GitHub Desktop.
Utilities
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
// 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