Skip to content

Instantly share code, notes, and snippets.

@pdfrod
Created June 16, 2015 15:11
Show Gist options
  • Save pdfrod/f8c32031536fd4b355bd to your computer and use it in GitHub Desktop.
Save pdfrod/f8c32031536fd4b355bd to your computer and use it in GitHub Desktop.
Scrap emails from attending.io
require 'nokogiri'
page = Nokogiri::HTML(open('attendees.html'))
page.css('li.attendee').each do |attendee|
name = attendee.css('.attendee__name > a:first-child').text.strip
email = attendee.to_s.scan(/mailto:([^"]+)/)[0][0]
puts "\"#{name}\",#{email}"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment