Skip to content

Instantly share code, notes, and snippets.

@AndrewVos
Created January 2, 2012 07:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AndrewVos/1549681 to your computer and use it in GitHub Desktop.
Save AndrewVos/1549681 to your computer and use it in GitHub Desktop.
1.upto(3) do | inner_count |
if @doc.css("table")[y+5].css("tr")[inner_count].css("td")[1].inner_text then
person = {}
[:title, :name, :phone, :email].each_with_index do |index, element|
node = @doc.css("table")[y+5].css("tr")[inner_count].css("td")[index]
if node
person[element] = node.inner_text
end
end
puts format_output(person, agency_name)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment