我们从Python开源项目中,提取了以下50个代码示例,用于说明如何使用bs4.builder.HTMLParserTreeBuilder()。
def default_builder(self): return HTMLParserTreeBuilder()
def test_builder_is_pickled(self): """Unlike most tree builders, HTMLParserTreeBuilder and will be restored after pickling. """ tree = self.soup("<a><b>foo</a>") dumped = pickle.dumps(tree, 2) loaded = pickle.loads(dumped) self.assertTrue(isinstance(loaded.builder, type(tree.builder)))