class parseImages(HTMLParser.HTMLParser): def handle_starttag(self, tag, attrs): if tag == 'img': for name,value in attrs: if name == 'src': getImage(urlString + "/" + value)
lParser = parseImages()
u = urllib.urlopen(urlString) print u.info()
lParser.feed(u.read()) lParser.close()
Related Scripts with Example Source Code in same category :