View Single Post
Old 11-20-2010, 11:24 AM   #2
Starson17
Wizard
Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.
 
Posts: 4,004
Karma: 177841
Join Date: Dec 2009
Device: WinMo: IPAQ; Android: HTC HD2, Archos 7o; Java:Gravity T
Quote:
Originally Posted by miwie View Post
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
Starson17 is offline   Reply With Quote