class Explosm(Comic): def __init__(self): Comic.__init__(self, 'Cyanide and Happiness') def getImageURL(self): feed = urllib.urlopen("http://www.explosm.net/comic/") match = re.search('src=(?P[\'"])(?Phttp://www.explosm.net/db/files/Comics/.*\.png)(?P=quote)', feed.read() ) try: return match.group('image') except IndexError: return None