`
zuroc
  • 浏览: 1313960 次
  • 性别: Icon_minigender_1
  • 来自: 江苏
社区版块
存档分类
最新评论

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/
分享到:
评论
2 楼 zuroc 2009-04-30  
To  frostyplanet 

有很多不规范的网页....
比如
pre中有<
1 楼 frostyplanet 2009-04-30  
转换一下html entities再用正则匹配就行啦,不用很复杂吧。
ps,在je上说句话都很麻烦阿。

相关推荐

    Python库 | wrf-python-1.1.3.tar.gz

    资源分类:Python库 所属语言:Python 资源全名:wrf-python-1.1.3.tar.gz 资源来源:官方 安装方法:https://lanzao.blog.csdn.net/article/details/101784059

    使用Python调用OpenAI接口-OpenAI接口调用python库源码.zip

    使用Python调用OpenAI接口-OpenAI接口调用python库源码.zip使用Python调用OpenAI接口-OpenAI接口调用python库源码.zip使用Python调用OpenAI接口-OpenAI接口调用python库源码.zip使用Python调用OpenAI接口-OpenAI接口...

    易语言python支持库

    "易语言Python支持库"就是为了让易语言能够更好地与Python进行交互,引入了对Python的支持,让易语言用户可以利用Python的丰富库资源。 这个支持库可能包含了以下几方面的内容: 1. **接口封装**:为了使易语言...

    Python库 | kitten-0.2.7.tar.gz

    资源分类:Python库 所属语言:Python 资源全名:kitten-0.2.7.tar.gz 资源来源:官方 安装方法:https://lanzao.blog.csdn.net/article/details/101784059

    Python库参考手册

    Python库参考手册是一份参考资料,它旨在帮助初学者在熟悉Python语言基础之后,深入理解Python语言附带的标准库的功能。通过这份手册,学习者可以了解到Python标准库中各个模块的具体用途和功能,以及如何利用这些...

    Python库 | thunder-python-1.1.0.tar.gz

    资源分类:Python库 所属语言:Python 资源全名:thunder-python-1.1.0.tar.gz 资源来源:官方 安装方法:https://lanzao.blog.csdn.net/article/details/101784059

    基于python的备忘记账系统论文.docx

    基于Python的备忘记账系统论文 本文探讨了基于Python的备忘记账系统的设计与实现。随着信息技术和网络技术的飞速发展,全新信息化时代的到来,传统管理技术已无法高效、便捷地管理信息。为迎合时代需求,优化管理...

    Python库 | PuLP-1.5.1.zip

    资源分类:Python库 所属语言:Python 资源全名:PuLP-1.5.1.zip 资源来源:官方 安装方法:https://lanzao.blog.csdn.net/article/details/101784059

    python 桌面备忘贴 备忘录

    python(tkinter) 桌面备忘贴 备忘录

    Python库 | jep-4.0.3.tar.gz

    资源分类:Python库 所属语言:Python 资源全名:jep-4.0.3.tar.gz 资源来源:官方 安装方法:https://lanzao.blog.csdn.net/article/details/101784059

    python 常用库速查表 备忘单 cheaksheets numpy pandas sklearn

    **Python常用库速查表** Python是一种广泛使用的高级编程语言,尤其在数据分析、机器学习和科学计算领域。这里我们关注的是一些核心的Python库,包括Numpy、Pandas、Scikit-learn(Sklearn)以及相关的数据处理和...

    Python库 | gm-3.0.0.7-py2-none-win32.whl

    资源分类:Python库 所属语言:Python 使用前提:需要解压 资源全名:gm-3.0.0.7-py2-none-win32.whl 资源来源:官方 安装方法:https://lanzao.blog.csdn.net/article/details/101784059

    Python-python库自助下载whl包

    在Python编程中,库是扩展其功能的重要工具。Python拥有庞大的第三方库生态系统,这些库通常通过pip(Python的包管理器)进行安装。然而,在某些网络环境不佳或特定平台下,直接使用pip安装可能会遇到困难。这时,...

    Python库 | uiautomation-1.0.9.zip

    资源分类:Python库 所属语言:Python 资源全名:uiautomation-1.0.9.zip 资源来源:官方 安装方法:https://lanzao.blog.csdn.net/article/details/101784059

    基于python实现备忘记账系统论文.docx

    由于Python丰富的库支持和强大的社区,开发备忘记账系统是完全可行的。同时,Python的跨平台性使得系统能在多种操作系统上运行。 (2)性能需求分析 系统需满足快速响应、数据安全和用户隐私保护的需求。此外,考虑到...

    Python库 | canmatrix-0.6-py2-none-any.whl

    资源分类:Python库 所属语言:Python 资源全名:canmatrix-0.6-py2-none-any.whl 资源来源:官方 安装方法:https://lanzao.blog.csdn.net/article/details/101784059

    全面的Python备忘单

    全面的Python备忘单:Contents 1. Collections: List, Dictionary, Set, Tuple, Range, Enumerate, Iterator, Generator. 2. Types: Type, String, Regular_Exp, Format, Numbers, Combinatorics, Datetime.3. ...

    Python库 | python-ccp-1.2.tar.gz

    资源分类:Python库 所属语言:Python 资源全名:python-ccp-1.2.tar.gz 资源来源:官方 安装方法:https://lanzao.blog.csdn.net/article/details/101784059

    Python库 | argparse-1.0.zip

    资源分类:Python库 所属语言:Python 资源全名:argparse-1.0.zip 资源来源:官方 安装方法:https://lanzao.blog.csdn.net/article/details/101784059

    python有趣的库python有趣的库

    python有趣的库python有趣的库python有趣的库python有趣的库python有趣的库python有趣的库python有趣的库python有趣的库python有趣的库python有趣的库python有趣的库python有趣的库python有趣的库python有趣的库...

Global site tag (gtag.js) - Google Analytics