Skip to content

Instantly share code, notes, and snippets.

@andrewhl
Created September 9, 2012 16:35
Show Gist options
  • Save andrewhl/3685505 to your computer and use it in GitHub Desktop.
Save andrewhl/3685505 to your computer and use it in GitHub Desktop.
def parse(page)
table = page.at("table.grid")
rows = table.search("tr").to_a[1..-1];
rows.map do |row|
parse_row row.search("td").map(&:text)
end
end
def parse_row(row)
if row[4] == "Demonstration"
raise "Invalid game type"
else
Row.new(*row)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment