Diagnostic functions, mainly for use when doing tech support.
Class |
|
Subclass of HTMLParser that announces parse events, without doing anything else. |
Function | benchmark |
Very basic head-to-head performance benchmark. |
Function | diagnose |
Diagnostic suite for isolating common problems. |
Function | htmlparser |
Print out the HTMLParser events that occur during parsing. |
Function | lxml |
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 |
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.
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.
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.