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

Popular posts from this blog

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -

java - Android recognize cell phone with keyboard or not? -

iphone - How would you achieve a LED Scrolling effect? -