html tool

2012年12月12日星期三

Dive into Python 的我的翻译 XXVI------8.7 II


Example 8.16. Quoting attribute values P113
  • [原文]P113
    >>> htmlSource = """--------------------------------------------------1
    ...     
    ...     
    ...     Test page
    ...     
...     
...     

...     
  • Home

  • ...     
  • Table of contents

  • ...     
  • Revision history

  • ...    
    ...    
    ...     """
    >>> from BaseHTMLProcessor import BaseHTMLProcessor
    >>> parser = BaseHTMLProcessor()
    >>> parser.feed(htmlSource)---------------------------------------------2
    >>> print parser.output()-----------------------------------------------3


    Test page



  • Home

  • Table of contents

  • Revision history



  • 没有评论:

    发表评论