summaryrefslogtreecommitdiff
path: root/bs4/diagnose.py
diff options
context:
space:
mode:
authorLeonard Richardson <leonard.richardson@canonical.com>2013-06-02 22:19:37 -0400
committerLeonard Richardson <leonard.richardson@canonical.com>2013-06-02 22:19:37 -0400
commit4a9444ac0b74fbf84cf86b9fcf6055c85e65f62a (patch)
tree570cbcb2c9ab9cf458edee87490afeffd8377560 /bs4/diagnose.py
parent11dad27424b319a2034f59f5a7f48286551102d0 (diff)
parent4f9a654766df9ddd05e3ef274b4715b42668724f (diff)
Merged in big encoding-detection refactoring branch.
Diffstat (limited to 'bs4/diagnose.py')
-rw-r--r--bs4/diagnose.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/bs4/diagnose.py b/bs4/diagnose.py
index 25fda5c..f9bff28 100644
--- a/bs4/diagnose.py
+++ b/bs4/diagnose.py
@@ -61,14 +61,14 @@ def diagnose(data):
print "-" * 80
-def lxml_trace(data, html=True):
+def lxml_trace(data, html=True, **kwargs):
"""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.
"""
from lxml import etree
- for event, element in etree.iterparse(StringIO(data), html=html):
+ for event, element in etree.iterparse(StringIO(data), html=html, **kwargs):
print("%s, %4s, %s" % (event, element.tag, element.text))
class AnnouncingParser(HTMLParser):