html2text

html2text trasforma pagine web e file HTML in testo semplice leggibile: titoli, elenchi, tabelle, link. Scrivi curl -s https://example.org | html2text, oppure html2text pagina.html.

versione 2.2.3 · Licenza: GPL-2.0-or-later · Sito del progetto

html2text

A cosa serve

Trasforma una pagina web o un file HTML in testo semplice da leggere: titoli, paragrafi, elenchi e tabelle restano, script, stili e menu spariscono. Con curl legge le pagine direttamente da internet.

Come si usa

Comando Cosa fa
curl -s https://example.org \| html2text una pagina web come testo
curl -s URL \| html2text \| less da sfogliare con calma
html2text pagina.html un file HTML della home
html2text -links pagina.html in fondo l'elenco degli indirizzi dei link
html2text -width 60 pagina.html va a capo a 60 colonne
curl -s URL \| html2text > pagina.txt salva il testo in un file

Con Anima

È un programma di sistema: Anima lo usa da sola quando serve una risposta esatta. Puoi anche chiederle di usarlo, per esempio "leggimi le notizie da questa pagina".

Limiti

Le pagine costruite da JavaScript (molti siti moderni) arrivano quasi vuote: il testo lo crea il browser, non c'è nell'HTML. Le pagine senza codifica dichiarata sono lette come UTF-8.

Nel Terminale

html2text

html2text turns web pages and HTML files into readable plain text: headings, lists, tables, links. Type curl -s https://example.org | html2text, or html2text page.html.

version 2.2.3 · License: GPL-2.0-or-later · Project site

html2text

What it is for

It turns a web page or an HTML file into plain readable text: headings, paragraphs, lists and tables stay, scripts, styles and menus go. With curl it reads pages straight from the internet.

How to use it

Command What it does
curl -s https://example.org \| html2text a web page as text
curl -s URL \| html2text \| less to page through it
html2text page.html an HTML file in the home folder
html2text -links page.html the link targets listed at the end
html2text -width 60 page.html wraps at 60 columns
curl -s URL \| html2text > page.txt saves the text to a file

With Anima

It is a system program: Anima uses it by itself when an exact answer is needed. You can also ask for it, for example "read me the news on this page".

Limits

Pages built by JavaScript (many modern sites) come out nearly empty: the browser makes that text, it is not in the HTML. Pages that declare no encoding are read as UTF-8.

In the Terminal