tag using Nokogiri?
I have to parse an HTML document into different new files. The problem is that there are text nodes which have not been wrapped with \"\"
tags, instead
After searching around some forums and doing some debugging locally, i have found the following solution to my problem.
html_doc = Nokogiri::HTML.parse('path/to/html_file')
html_doc
html_doc.search("//br/preceding-sibling::text()|//br/following-sibling::text()").each do |node|
node.replace(Nokogiri.make("#{node.to_html}
"))
end