Actually, I would go back to your source HTML. If you don't already have a local copy then save one from the web. Next download calibre:
http://calibre.kovidgoyal.net/download
You can easily "Add Books" in Calibre to import an HTML file. Then you can convert it using Calibre to any desirable output format.
********* Edit **************
I see Superlucky beat me to the calibre recommendation