From 6d7cfb69c5c11cb98b10a2de0900b0f9b6ada6b8 Mon Sep 17 00:00:00 2001 From: Leonard Richardson Date: Wed, 8 Apr 2009 16:30:23 -0400 Subject: Added an LXML builder and a stupid test. --- lxml_test.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 lxml_test.py (limited to 'lxml_test.py') diff --git a/lxml_test.py b/lxml_test.py new file mode 100644 index 0000000..99375dd --- /dev/null +++ b/lxml_test.py @@ -0,0 +1,13 @@ +from BeautifulSoup import BeautifulStoneSoup, BeautifulSoup +from lxml_builder import LXMLBuilder +from lxml import etree +builder = LXMLBuilder() +soup = BeautifulStoneSoup("bar", builder=builder) +print soup.prettify() + +soup = BeautifulSoup("bar", builder=builder) +print soup.prettify() + +builder = LXMLBuilder(parser_class=etree.HTMLParser, self_closing_tags=["br"]) +soup = BeautifulSoup("test<body><h1>page<br />title</h1>", builder=builder) +print soup.prettify() -- cgit v1.2.3