module documentation

Diagnostic functions, mainly for use when doing tech support.

Class AnnouncingParser Subclass of HTMLParser that announces parse events, without doing anything else.
Function benchmark_parsers Very basic head-to-head performance benchmark.
Function diagnose Diagnostic suite for isolating common problems.
Function htmlparser_trace Print out the HTMLParser events that occur during parsing.
Function lxml_trace Print out the lxml events that occur during parsing.
Function profile Use Python's profiler on a randomly generated document.
Function rdoc Randomly generate an invalid HTML document.
Function rsentence Generate a random sentence-like string.
Function rword Generate a random word-like string.
Variable __license__ Undocumented
Variable _consonants Undocumented
Variable _vowels Undocumented
def benchmark_parsers(num_elements=100000): (source)

Very basic head-to-head performance benchmark.

def diagnose(data): (source)

Diagnostic suite for isolating common problems. :param data: A string containing markup that needs to be explained. :return: None; diagnostics are printed to standard output.

def htmlparser_trace(data): (source)

Print out the HTMLParser events that occur during parsing. This lets you see how HTMLParser parses a document when no Beautiful Soup code is running. :param data: Some markup.

def lxml_trace(data, html=True, **kwargs): (source)

Print out the lxml events that occur during parsing. This lets you see how lxml parses a document when no Beautiful Soup code is running. You can use this to determine whether an lxml-specific problem is in Beautiful Soup's lxml tree builders or in lxml itself. :param data: Some markup. :param html: If True, markup will be parsed with lxml's HTML parser. if False, lxml's XML parser will be used.

def profile(num_elements=100000, parser='lxml'): (source)

Use Python's profiler on a randomly generated document.

def rdoc(num_elements=1000): (source)

Randomly generate an invalid HTML document.

def rsentence(length=4): (source)

Generate a random sentence-like string.

def rword(length=5): (source)

Generate a random word-like string.

__license__: str = (source)

Undocumented

_consonants: str = (source)

Undocumented

Undocumented