Skip to content

Commit

Permalink
Also scrape images
Browse files Browse the repository at this point in the history
The version on the site claims to be a thumbnail, and is very small, but
I can't find a larger version.
  • Loading branch information
tmtmtmtm committed Apr 29, 2017
1 parent d08a2a8 commit 55aa8ef
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/member_page.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ class MemberPage < Scraped::HTML
noko.xpath('//h3[.="Birth Date / Place"]/following::p').map(&:text).map(&:tidy).first[/(\d{4}-\d{2}-\d{2})/, 1]
end

# TODO: is there a higher quality version of this?
field :image do
noko.css('.mp-portrait .imgc img/@src').text
end

field :email do
noko.css('img[src*="sms.png"] + p').text.tidy
end
Expand Down
1 change: 1 addition & 0 deletions test/data/anzor-bolkvadze.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
:name: Anzor Bolkvadze
:birth_date: '1960-09-09'
:email: abolkvadze@parliament.ge
:image: http://www.chemiparlamenti.ge/sites/default/files/styles/parliamentarian_thumbnail/public/2017-01/2431.jpg?itok=6xA5p1D5
:party: The Georgian Dream
:start_date: '2016-11-18'
:end_date:
Expand Down

0 comments on commit 55aa8ef

Please sign in to comment.