Skip to content

Instantly share code, notes, and snippets.

@cfcosta
Created August 16, 2011 13:55

Revisions

  1. Cainã Costa created this gist Aug 16, 2011.
    7 changes: 7 additions & 0 deletions gistfile1.rb
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,7 @@
    def table_at(selector)
    Nokogiri::HTML(page.body).css(selector).map do |table|
    table.css('tr').map do |tr|
    tr.css('td').map { |td| td.text }
    end
    end[0].reject(&:empty?)
    end