Quote:
Originally Posted by miwie
A newspaper holds thumbnails for every edition on a gallery page.
How can I fetch the value of an "<img src="..."> (inside a specific "<div class="XXX">") in "get_cover_url(self)" to get this image file as cover image.
Michael
|
Code:
def get_cover_url(self):
cover_url = None
index = 'http://some.where.com/some-page'
soup = self.index_to_soup(index)
link_item = soup.find('div',attrs={'class':'XXX'})
if link_item:
cover_url = link_item.img['src']
return cover_url