Last active
September 25, 2017 21:57
-
-
Save serradura/7d5ce5ad96c1dfc0ca5d6e94ff0b5f35 to your computer and use it in GitHub Desktop.
artoo.js meetup.com attendees scraper
This file contains hidden or 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
// Dependency: https://medialab.github.io/artoo/ | |
// Recommendation: Use the script with Google Chrome DevTools console. | |
let attendees; | |
attendees = $('.attendee-item').map(function(_index, attendee) { | |
const $attendee = $( attendee ); | |
const $avatar = $attendee.find('a.avatar'); | |
const image = $avatar.css('background-image').match(/"(.*)"/i)[1]; | |
const profile = $avatar.attr('href'); | |
const name = $attendee.find('h4').text(); | |
let question, answer; | |
const $answers = $attendee.find('.attendee-item-answers'); | |
if ( $answers.length ) { | |
question = $answers.find('dt').text(); | |
answer = $answers.find('dd').text(); | |
} | |
return { name, image, profile, question, answer }; | |
}).get() | |
artoo.saveCsv(attendees, 'meetup-attendees.csv'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment