Written by BroytMann. Copyright (C) 2007 PhiloSoft Design
"""
+from HTMLParser import HTMLParser
from BeautifulSoup import BeautifulSoup
-class DummyParser(object):
+class BSoupParser(HTMLParser):
def __init__(self, charset, meta, title, refresh, icon):
object.__init__(self)
self.charset = charset
self.refresh = refresh
self.icon = icon
+
def parse_html(filename, charset=None):
infile = open(filename, 'r')
root = BeautifulSoup(infile, fromEncoding=charset)
else:
icon = None
- parser = DummyParser(charset, False, title, refresh, icon)
+ parser = BSoupParser(charset, False, title, refresh, icon)
return parser
def _find_refresh(Tag):