Skip to content

Instantly share code, notes, and snippets.

@asciimo
Created October 18, 2017 18:15
Show Gist options
  • Save asciimo/7ce7bbea8ab8541133ce69b8a23172db to your computer and use it in GitHub Desktop.
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
// 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