Skip to content

Commit

Permalink
modifies to save record in morph.io
Browse files Browse the repository at this point in the history
  • Loading branch information
rezzo committed May 6, 2014
1 parent b051d01 commit 5b6c8f2
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions scraper.rb
Expand Up @@ -17,16 +17,17 @@ def per_person profile_url, uid, party, current_stand
"name" => (profile[0].inner_text).gsub('Nombre:','').squeeze(' ').strip,
"party" => party,
"current_stand" => current_stand,
"email" => '', #(profile[1].inner_text).gsub('E-mail:','').squeeze(' ').strip, #Can't scrape this value, is protected by Cloudflare http://www.cloudflare.com/email-protection
"email" => '', #(profile[1].inner_text).gsub('E-mail:','').squeeze(' ').strip, #Can't scrape this value, it's protected by Cloudflare http://www.cloudflare.com/email-protection
"phone" => (profile[2].inner_text).gsub('Teléfono de Oficina:','').strip,
"address" => (profile[3].inner_text).gsub('Dirección de Oficina:','').strip,
"url" => profile_url
}

puts '<---------------'
puts record
puts '--------------/>'
# ScraperWiki.save_sqlite(["uid"], record)
#puts '<---------------'
#puts record
#puts '--------------/>'
ScraperWiki.save_sqlite(["uid"], record)
puts "Adds new record " + record['name']
end

# Obtains the profiles
Expand Down Expand Up @@ -64,4 +65,4 @@ def process
# Runner
if !(defined? Test::Unit::TestCase)
Diputados.new.process
end
end

0 comments on commit 5b6c8f2

Please sign in to comment.