public
Description: A handful (but hopefully growing amount) of scRUBYt! examples
Homepage: http://scrubyt.org
Clone URL: git://github.com/scrubber/scrubyt_examples.git
scrubyt_examples / linkedin.rb
100644 26 lines (18 sloc) 0.596 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# Scrapes your friends on linkedin
#
# Obviously you need to supply your username/password
require 'rubygems'
require 'scrubyt'
 
property_data = Scrubyt::Extractor.define :agent => :firefox do
  fetch 'https://www.linkedin.com/secure/login'
  fill_textfield 'session_key', '*****'
  fill_textfield 'session_password', '*****'
  submit
 
  click_link_and_wait 'Connections', 5
  
  vcard "//li[@class='vcard']" do
    first_name "//span[@class='given-name']"
    second_name "//span[@class='family-name']"
    email "//a[@class='email']"
  end
end
 
puts property_data.to_xml