HtmlToText python库备忘

http://pypi.python.org/pypi/htmltotext/

HtmlToText  

The htmltotext module

This python module extracts the textual content and metadata from HTML pages. It tries to cope with invalid markup and incorrectly specified character sets, and strips out HTML tags (splitting words at tags appropriately). It also discards the contents of script tags and style tags.

As well as text from the body of the page, it extracts the page title, and the content of meta description and keyword tags. It also parses meta robots tags to determine whether the page should be indexed.

The HTML parser used by this module was extracted from the Xapian search engine library (and specifically, from the omindex indexing utility in that library).
Latest sources
这个是从Xapian 中提取出来的
C模块 应该不会太慢


用法如

a=htmltotext.extract(a)
a.content






The latest sources for htmltotext live in the flaxcode SVN repository, under trunk/libs/htmltotext/

你可能感兴趣的:(html,C++,c,python,SVN)