1
doc = Nokogiri::HTML(open(url)).xpath("//*")
.xpath("//*[br]/text()[string-length(normalize-space()) != 0]")
.wrap("<span></span>")
puts doc
il retourne juste le texte ... Je m'attendais à la source html complète avec maintenant enroulé autour des éléments xpath spécifiés.pourquoi je ne peux pas envelopper <span> autour de la xpath nokogiri rfollowing?