Извлечь HTML текстовые файлы в текстовый файл

440
Meds

У меня есть папка с большим количеством HTML-файлов, я хотел бы извлечь только текст, содержащийся в теле этого HTML-файла в текстовый файл, как я могу это сделать?

0

1 ответ на вопрос

1
rbialon

You can iterate over each file in the directory and use a command-line browser such as lynx or w3m to render the HTML to plaintext and save this into a text file.

Lynx example:

lynx -dump in.html > out.txt 

w3m example:

w3m -dump in.html > out.txt 

Похожие вопросы