Sample Header Ad - 728x90

Why is html2text not able to read local .html files?

-1 votes
1 answer
701 views
While I have seen several questions similar to the one I am going to ask, for example, https://unix.stackexchange.com/questions/275370/how-can-i-convert-all-the-html-files-i-get-into-text-files-after-a-wget-command/ I also saw a blog post which describes it and have seen it works.  I tried it even locally and found even that works but in local files i.e. files which are residing say in some /usr/share/doc/$PACKAGENAME/index.html and number of pages linked therein, there should be an easier way to get at least the top page. I tried doing something like: html2text file:///usr/share/doc/$PACKAGENAME/html/index.html > packagename-doc.txt but that didn't work.  I get the output: Cannot open input file "file:///usr/share/doc/$PACKAGENAME/html/index.html". I am not giving any package names as it doesn't really matter and there are so many packages nowadays that give documentation in HTML pages rather than man or info, but that's outside the topic altogether. Can somebody either tell why or give an alternative way of doing it, either via html2text or some other tool that does it in a simple way?
Asked by shirish (12954 rep)
Apr 25, 2018, 11:52 PM
Last activity: Jun 9, 2024, 05:54 PM