LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Convert HTML to ASCII (https://www.linuxquestions.org/questions/programming-9/convert-html-to-ascii-813133/)

ministeren 06-09-2010 08:33 AM

Convert HTML to ASCII
 
Hi guys. I have a little question :).

i have made the following script:

#!/bin/bash
wget -r --user=chris --password=chris http://server1/logs.html
cd /root/chris/server1
firefox logs.html

the script copies and firefox it and show this as HTML and it works for me.

But how can i make it show me the output as ASCII text and not HTML ?.
i have tryied to pipe it out to LESS and MORE without firefoxing it, but it doesnt work for me.

Thanks in advance gents.

//Chris

pixellany 06-09-2010 08:50 AM

I think you mean show it as plain text. Even the html is being encoded as ascii. You need an "html to text converter" (which of course is what a browser is......)

Have you searched on Google?

Or maybe "man -k html"

bathory 06-09-2010 09:09 AM

Hi,

You can use lynx to dump the URL into ascii:
Code:

lynx -dump -auth=chris:chris http://server1/logs.html > logs.txt
Regards

CoderMan 06-09-2010 03:40 PM

Or just display it using the links text-only web browser:

Code:

links log.html
Might need to install links first.


All times are GMT -5. The time now is 04:34 PM.