Skip to content

Instantly share code, notes, and snippets.

@dbrady
Created Feb 3, 2009
Embed
What would you like to do?
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