"""
HTML Parser
- Written by BroytMann. Copyright (C) 1997-2005 PhiloSoft Design
+ Written by BroytMann. Copyright (C) 1997-2007 PhiloSoft Design
"""
self.title = self.accumulator
+ def do_link(self, attrs):
+ has_icon = False
+ href = None
+
+ for attrname, value in attrs:
+ if value:
+ value = value.strip().lower()
+ if (attrname == 'rel') and (value in ('icon', 'shortcut icon')):
+ has_icon = True
+ elif attrname == 'href':
+ href = value
+
+ if has_icon:
+ self.icon = href
+ else:
+ self.icon = None
+
+
import re
entity_re = re.compile("(&#[0-9]+;)")
print parser.charset
print parser.title
print parser.refresh
+ print parser.icon