From 5b6c8f25e2decd3093fe5cd7463e84417e668034 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=2E=20Pablo=20P=C3=A9rez=20Trabucco?= Date: Tue, 6 May 2014 19:12:21 -0400 Subject: [PATCH] modifies to save record in morph.io --- scraper.rb | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/scraper.rb b/scraper.rb index 7fd8b42..0771733 100644 --- a/scraper.rb +++ b/scraper.rb @@ -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 @@ -64,4 +65,4 @@ def process # Runner if !(defined? Test::Unit::TestCase) Diputados.new.process -end \ No newline at end of file +end