Best way to convert HTML to plaintext using Python

﹥>﹥吖頭↗ 提交于 2019-12-21 04:08:27

问题


I'm working on a project that involves converting a large amount of HTML content to plain/text. I have a custom-written module that does the job OK, but I'm wondering if there's some standard tools to help get the job done.


回答1:


Html2Text seems to be a good option




回答2:


Here's a python library which does HTML parsing:

  • lxml.html

BeautifulSoup is another option.



来源:https://stackoverflow.com/questions/1668081/best-way-to-convert-html-to-plaintext-using-python

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!