test_html5lib.py 文件源码

python
阅读 21 收藏 0 点赞 0 评论 0

项目:GUIYoutube 作者: coltking 项目源码 文件源码
def test_soupstrainer(self):
        # The html5lib tree builder does not support SoupStrainers.
        strainer = SoupStrainer("b")
        markup = "<p>A <b>bold</b> statement.</p>"
        with warnings.catch_warnings(record=True) as w:
            soup = self.soup(markup, parse_only=strainer)
        self.assertEqual(
            soup.decode(), self.document_for(markup))

        self.assertTrue(
            "the html5lib tree builder doesn't support parse_only" in
            str(w[0].message))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号