当前位置: 首页>>代码示例>>Python>>正文


Python html.parser方法代码示例

本文整理汇总了Python中html.parser方法的典型用法代码示例。如果您正苦于以下问题:Python html.parser方法的具体用法?Python html.parser怎么用?Python html.parser使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在html的用法示例。


在下文中一共展示了html.parser方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_html_import

# 需要导入模块: import html [as 别名]
# 或者: from html import parser [as 别名]
def test_html_import(self):
        import html
        import html.entities
        import html.parser
        self.assertTrue(True) 
开发者ID:hughperkins,项目名称:kgsgo-dataset-preprocessor,代码行数:7,代码来源:test_standard_library.py

示例2: test_with_deleted_parent

# 需要导入模块: import html [as 别名]
# 或者: from html import parser [as 别名]
def test_with_deleted_parent(self):
        # see #18681
        from html import parser
        html = sys.modules.pop('html')
        def cleanup():
            sys.modules['html'] = html
        self.addCleanup(cleanup)
        with self.assertRaisesRegex(ImportError, 'html'):
            imp.reload(parser) 
开发者ID:Microvellum,项目名称:Fluid-Designer,代码行数:11,代码来源:test_imp.py

示例3: simple_parse_to_segments

# 需要导入模块: import html [as 别名]
# 或者: from html import parser [as 别名]
def simple_parse_to_segments(html, debug=False, **kwargs):
    html = fix_urls(html)
    html = '<html>' + html + '</html>' # html.parser seems to ignore the final entityref without html closure
    parser = simpleHTMLParser(debug)
    return parser.feed(html) 
开发者ID:hangoutsbot,项目名称:hangoutsbot,代码行数:7,代码来源:kludgy_html_parser.py

示例4: test_future_moves

# 需要导入模块: import html [as 别名]
# 或者: from html import parser [as 别名]
def test_future_moves(self):
        """
        Ensure everything is available from the future.moves interface that we
        claim and expect. (Issue #104).
        """
        from future.moves.collections import Counter, OrderedDict   # backported to Py2.6
        from future.moves.collections import UserDict, UserList, UserString

        from future.moves import configparser
        from future.moves import copyreg

        from future.moves.itertools import filterfalse, zip_longest

        from future.moves import html
        import future.moves.html.entities
        import future.moves.html.parser

        from future.moves import http
        import future.moves.http.client
        import future.moves.http.cookies
        import future.moves.http.cookiejar
        import future.moves.http.server

        from future.moves import queue

        from future.moves import socketserver

        from future.moves.subprocess import check_output              # even on Py2.6
        from future.moves.subprocess import getoutput, getstatusoutput

        from future.moves.sys import intern

        from future.moves import urllib
        import future.moves.urllib.error
        import future.moves.urllib.parse
        import future.moves.urllib.request
        import future.moves.urllib.response
        import future.moves.urllib.robotparser

        try:
            # Is _winreg available on Py2? If so, ensure future.moves._winreg is available too:
            import _winreg
        except ImportError:
            pass
        else:
            from future.moves import winreg

        from future.moves import xmlrpc
        import future.moves.xmlrpc.client
        import future.moves.xmlrpc.server

        from future.moves import _dummy_thread
        from future.moves import _markupbase
        from future.moves import _thread 
开发者ID:hughperkins,项目名称:kgsgo-dataset-preprocessor,代码行数:56,代码来源:test_standard_library.py


注:本文中的html.parser方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。