View Single Post
Old 01-29-2010, 07:40 PM   #3
nickredding
onlinenewsreader.net
nickredding knows the difference between 'who' and 'whom'nickredding knows the difference between 'who' and 'whom'nickredding knows the difference between 'who' and 'whom'nickredding knows the difference between 'who' and 'whom'nickredding knows the difference between 'who' and 'whom'nickredding knows the difference between 'who' and 'whom'nickredding knows the difference between 'who' and 'whom'nickredding knows the difference between 'who' and 'whom'nickredding knows the difference between 'who' and 'whom'nickredding knows the difference between 'who' and 'whom'nickredding knows the difference between 'who' and 'whom'
 
Posts: 320
Karma: 10143
Join Date: Dec 2009
Location: Phoenix, AZ & Victoria, BC
Device: Kindle 3, Kindle Fire, IPad3, iPhone4, Playbook, HTC Inspire
Actually, the following is safer since the test tag['size'] doesn't work if there is no attribute 'size'.
Code:
    
def preprocess_html(self, soup):
        for tag in soup.findAll('font'):
            if tag.has_key('size'):
                if tag['size'] == '+2':
                    if tag.b:
                        return soup
        return None
nickredding is offline   Reply With Quote