Created
October 18, 2017 18:15
-
-
Save asciimo/7ce7bbea8ab8541133ce69b8a23172db to your computer and use it in GitHub Desktop.
How to use Javascript to get a list of everyone who selected "Interested" on a Facebook event
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
// First, click on the event link that looks like "0 Going · 28 Interested" and then "inspect element" on the modal | |
const list = document.getElementsByClassName("uiScrollableAreaBody")[6] // Your markup may vary. The One I wanted was index 6 | |
const people = list.getElementsByTagName("span") // HTMLCollection | |
const peopleArray = [].slice.call(people) // Convert to an array we can map() | |
peopleArray.map(personEl => personEl.innerText) // Copy the results and clean up in Vim :D |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment