How to convert HTML file to text on Linux

How to convert HTML file to a text on Linux?

asked Nov 20, 2013 by anonymous

1 Answer

Best answer

You can use html2text (can be installed on Fedora by yum install html2text):

$ html2text ${html_file}

${html_file} is the html file to be converted. The converted text will be printed to the STDOUT. You can redirect it to a file if it is needed.

answered Nov 20, 2013 by anonymous

Adding -style pretty can make html2text prints additional spaces/lines to make the text look more prettier.

commented Dec 17, 2013 by anonymous

The -width 100 option may help for pages that are rendered strangely.

commented Dec 31, 2013 by anonymous

Please log in or register to answer this question.

Copyright © SysTutorials. User contributions licensed under cc-wiki with attribution required.
Hosted on Dreamhost