Skip to content

Instantly share code, notes, and snippets.

@dbrady
Created February 3, 2009 21:19
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 dbrady/57767 to your computer and use it in GitHub Desktop.
Save dbrady/57767 to your computer and use it in GitHub Desktop.
require 'rubygems'
require 'nokogiri'
doc = Nokogiri::HTML.parse(<<-eohtml)
<table>
<tr><td>9</td><td>MRobinson</td></tr>
<tr><td>10</td><td>RGoldblatt</td></tr>
<tr><td>11</td><td>JBrancato</td></tr>
<tr><td>XX</td><td><table><tr><td>Poo</td></tr></table></td></tr>
</table>
</body>
</html>
eohtml
puts doc.css('table > tr').size
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment