리눅스 html2text

리눅스 html2text
/usr/bin/html2text

1 실습 1: 로컬 HTML 파일[ | ]

Console
Copy
[root@zetawiki ~]# cat /var/www/error/noindex.html | head -5
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
    <head>
        <title>Test Page for the Nginx HTTP Server on Fedora</title>
Console
Copy
[root@zetawiki ~]# cat /var/www/error/noindex.html | html2text | head -5
****** Welcome to nginx on Fedora! ******
This page is used to test the proper operation of the nginx HTTP server after
it has been installed. If you can read this page, it means that the web server
installed at this site is working properly.
***** Website Administrator *****

2 실습 2: 원격 HTML 파일[ | ]

Console
Copy
[root@zetawiki ~]# curl -s http://zetawiki.com/ex/html5/select-listbox.php
<select name='fruits' size='10'>
<option value='' selected='selected'>-- 선택 --</option>
<option value='apple'>사과</option>
<option value='banana'>바나나</option>
<option value='lemon'>레몬</option>
Console
Copy
[root@zetawiki ~]# curl -s http://zetawiki.com/ex/html5/select-listbox.php | html2text -utf8
[One of: -- 선택 --/사과/바나나/레몬]

3 같이 보기[ | ]