ruby - How to find tags that aren't empty with Nokogiri? -
i got code, want grab p-tags aren't empty, how do that?
doc.css('p').first(3).each |paragraph| puts raw(paragraph) end
use select
:
doc.css('p').select{ |n| n.inner_text }.each |paragraph| puts raw(paragraph) end
Comments
Post a Comment