Skip to content

Commit

Permalink
cope with missing email
Browse files Browse the repository at this point in the history
  • Loading branch information
struan committed Sep 21, 2016
1 parent 8340631 commit 9640db6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion scraper.rb
Expand Up @@ -85,7 +85,7 @@ def scrape_list(url, base_url)
def get_extra_data(url)
noko = noko_for(url)
contacts = noko.css('div.box-contact a')
email = contacts.first.text
email = contacts.first.text rescue nil
website = contacts[1].css('@href').to_s if contacts[1]
details = noko.css('#passport dl')
dob = details.xpath('//dl/dt[contains(.,"Date of birth")]/following-sibling::dd[not(position() > 1)]/text()')
Expand Down

0 comments on commit 9640db6

Please sign in to comment.