當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。