Skip to content

Commit

Permalink
Choose first a element, the second can be a footnote
Browse files Browse the repository at this point in the history
  • Loading branch information
lukes committed Jul 24, 2018
1 parent 367928d commit 64ed885
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion scrubber.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,12 @@
country_name.search("span.flagicon").remove # Remove the flags from country column

country = {}
country["name"] = DECODE_ENTITIES.call(country_name.css("a").inner_html.strip) rescue nil
country["name"] = DECODE_ENTITIES.call(country_name.css("a").first.inner_html.strip) rescue nil
country["alpha-2"] = DECODE_ENTITIES.call(iso_alpha_2.css("span").inner_html.strip) rescue nil
country["alpha-3"] = DECODE_ENTITIES.call(iso_alpha_3.css("span").inner_html.strip) rescue nil
country["country-code"] = DECODE_ENTITIES.call(country_code.css("span").inner_html.strip) rescue nil
country["iso_3166-2"] = DECODE_ENTITIES.call(iso_3166_2.css("a").inner_html.strip) rescue nil

data << country unless country.values.any?(&:blank?)
end

Expand Down

0 comments on commit 64ed885

Please sign in to comment.