Skip to content

Instantly share code, notes, and snippets.

@marcosanson
Created October 10, 2012 08:32
Show Gist options
  • Save marcosanson/3864065 to your computer and use it in GitHub Desktop.
Save marcosanson/3864065 to your computer and use it in GitHub Desktop.
how to count divs with one line of code (Ruby)
puts Nokogiri::HTML(open("http://example.com/example")).css("div.example").count
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment