Permalink
Browse files

Add hardcoded term, only getting most recent term

  • Loading branch information...
jennahowe committed Oct 14, 2015
1 parent b35079c commit 5691c28a733f969ddafc07f098a2def63d0b6e17
Showing with 8 additions and 1 deletion.
  1. +8 −1 scraper.rb
View
@@ -28,9 +28,12 @@ def noko_for(url)
sleep_between_requests = 60 # (seconds) be kind to El Salvador's server!
# Not scraping this because there seem to be mistakes on the page,
term = "2015-2018"
if local == 'true'
require 'pry'
la_url = 'http://localhost:8000/pleno_legislativo.html'
la_url = 'http://localhost:4000/pleno_legislativo.html'
else
la_url = 'http://asamblea.gob.sv/pleno/pleno-legislativo'
end
@@ -175,6 +178,8 @@ def noko_for(url)
image = p.xpath("//h1/following-sibling::img[1]/@src").text.sub(/.*\//, "#{person_url}/")
puts "image: #{image}\n"
puts "term: #{term}\n"
data = {
id: id,
@@ -184,7 +189,9 @@ def noko_for(url)
email__personal: personal_email,
image: image,
source: person_url,
term: term,
}
ScraperWiki.save_sqlite([:id], data)
sleep(sleep_between_requests)

0 comments on commit 5691c28

Please sign in to comment.