My below code is working fine. But can the same output be achieved with
some a more compact CSS selectors?
require ‘nokogiri’
doc = Nokogiri::HTML::Document.parse <<-end
something |
|
nodeset = doc.css(“table”)
nodeset.css(“tbody:nth-child(1)”).map{|n| n.css(’>tr’).to_a.size}