I wrote a web crawler in Ruby and I\'m using Nokogiri::HTML
to parse the page. I need to print the page out and while messing around in IRB I noticed a pr
I know I am extremely late to answer this question, but still, I'll leave the answer. I tried all the above steps and it does work to an extent.
Nokogiri
does format the HTML
but does not care about the closing or the opening tag, hence pretty format is out of the picture.
I found a gem called htmlbeautifier that works like a charm. I hope other people who are still searching for the answer will find this valuable.