Permalink
Browse files

Remove MemberPage from scraper.rb

This was already pulled out to its own file in ffe6643
  • Loading branch information...
tmtmtmtm committed Apr 30, 2017
1 parent a3acf24 commit 31c65c9a5a1b405fb877c4016aeb21971c49a4d3
Showing with 0 additions and 36 deletions.
  1. +0 −36 scraper.rb
View
@@ -83,42 +83,6 @@ def tds
end
end
class MemberPage < FolketingPage
field :name do
box.css('h1').text.tidy
end
field :constituency do
raw_memberships.first.to_s[/ in (.*?) from/, 1].to_s.sub('greater constituency', '').tidy
end
field :email do
box.css('div.person a[href*="mailto:"]/@href').text.gsub('mailto:', '').tr('|/', ';')
end
field :homepage do
box.css('div.person a[href*="http"]/@href').text
end
field :image do
box.css('div.person img/@src').text
end
field :memberships do
raw_memberships.join('+++')
end
private
def box
noko.css('#mainform')
end
def raw_memberships
box.xpath('.//strong[contains(.,"Member period")]/following-sibling::text()').map(&:text)
end
end
def scrape(h)
url, klass = h.to_a.first
klass.new(response: Scraped::Request.new(url: url).response)

0 comments on commit 31c65c9

Please sign in to comment.