Python_API_Structured Markup Processing Tools_sgmllib.SGMLParser
2012-04-07 15:59
267 查看
API文档:
This module defines a class SGMLParser which serves as the basis for parsing text files formatted in SGML (Standard Generalized Mark-up Language). In fact, it does not provide a full SGML parser — it only parses SGML insofar
as it is used by HTML, and the module only exists as a base for the htmllib module. Another HTML parser which supports XHTML and offers a somewhat different interface is available in the HTMLParser module.
class
sgmllib.SGMLParser The
SGMLParser class is instantiated without arguments. The parser is hardcoded to recognize the following constructs:
Opening and closing tags of the form
<tag attr="value"
...> and </tag>, respectively.
Numeric character references of the form
name;.
Entity references of the form
&name;.
SGML comments of the form
<!--text-->. Note that spaces, tabs, and newlines are allowed between the trailing
> and the immediately preceding
--.
翻译文档:
这个模块定义了一个SGMLParser类,这个类提供了解析SGML(标准通用标示语言)的功能。
但是他并没有提供完整的对SGML的解析功能。这个模块只是为htmllib模块定义了一个基本的方法。这个HTMLParser模块定义了以写可解析XHTML的方法和其他功能。
这个SGMLParser类是不带参数的实例。可通过编码接卸如下文档结构:
可分别标签开始和结束。例如 :<tag
attr="value" ...> and
</tag>,
特殊字符引用。例如:name;.等,16进制字符转化等
实体引用。例如:html©
注释:<!--->
This module defines a class SGMLParser which serves as the basis for parsing text files formatted in SGML (Standard Generalized Mark-up Language). In fact, it does not provide a full SGML parser — it only parses SGML insofar
as it is used by HTML, and the module only exists as a base for the htmllib module. Another HTML parser which supports XHTML and offers a somewhat different interface is available in the HTMLParser module.
class
sgmllib.SGMLParser The
SGMLParser class is instantiated without arguments. The parser is hardcoded to recognize the following constructs:
Opening and closing tags of the form
<tag attr="value"
...> and </tag>, respectively.
Numeric character references of the form
name;.
Entity references of the form
&name;.
SGML comments of the form
<!--text-->. Note that spaces, tabs, and newlines are allowed between the trailing
> and the immediately preceding
--.
翻译文档:
这个模块定义了一个SGMLParser类,这个类提供了解析SGML(标准通用标示语言)的功能。
但是他并没有提供完整的对SGML的解析功能。这个模块只是为htmllib模块定义了一个基本的方法。这个HTMLParser模块定义了以写可解析XHTML的方法和其他功能。
这个SGMLParser类是不带参数的实例。可通过编码接卸如下文档结构:
可分别标签开始和结束。例如 :<tag
attr="value" ...> and
</tag>,
特殊字符引用。例如:name;.等,16进制字符转化等
实体引用。例如:html©
注释:<!--->
相关文章推荐
- Python_API_Structured Markup Processing Tools_sgmllib.SGMLParser.feed
- Python_API_Structured Markup Processing Tools_sgmllib.SGMLParser.reset
- python sgmllib.SGMLParser的学习
- Python HTML Resolution Demo - SGMLParser & PyQuery
- python SGMLParser学习的一点心得
- SGMLParser (二) 分类: python 小练习 HTMLParser 2014-02-20 14:06 362人阅读 评论(0) 收藏
- [python]SGMLParser是如何工作的
- Processing binary structured data with Python
- 用python解析html[SGMLParser]
- Python itertools 模块 api
- Python SGMLParser 的1个BUG??
- python网页解析之SGMLParser
- 用python解析html[SGMLParser]
- 用python解析html--SGMLParser
- 解析html的python库--SGMLParser
- 疑似BUG:Python SGMLParser处理html中的javascript失当
- Python SGMLParser简介
- 用python解析html--SGMLParser
- OpenDayLight 氢版本 RestAPI 调用实例(3)-下发流表(Python)