Lines Matching full:parser
7 from html.parser import HTMLParser
26 basic_parsers = ["html.parser", "html5lib", "lxml"]
66 for parser in basic_parsers:
67 print("Trying to parse your markup with %s" % parser)
70 soup = BeautifulSoup(data, parser)
73 print("%s could not parse the markup." % parser)
76 print("Here's what %s did with the markup:" % parser)
130 parser = AnnouncingParser()
131 parser.feed(data)
171 print("Comparative parser benchmark on Beautiful Soup %s" % __version__)
175 for parser in ["lxml", ["lxml", "html"], "html5lib", "html.parser"]:
179 soup = BeautifulSoup(data, parser)
183 print("%s could not parse the markup." % parser)
186 print("BS4+%s parsed the markup in %.2fs." % (parser, b-a))
195 parser = html5lib.HTMLParser()
197 parser.parse(data)
201 def profile(num_elements=100000, parser="lxml"): argument
207 vars = dict(bs4=bs4, data=data, parser=parser)
208 cProfile.runctx('bs4.BeautifulSoup(data, parser)' , vars, vars, filename)