View Single Post
Old 08-31-2010, 08:21 PM   #2583
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 TonytheBookworm View Post
I know i'm close to getting this yet seem so far away.
Here is what I gave you last time. Why doesn't that work?
Spoiler:
Code:
        for item in soup.findAll('h2'):
            link = item.find('a')
            if link:


In line 1 it finds all the <h2> tags.
In line 2 it looks at each one to decide if there is an <a> tag inside.
In line 3, if there was an <a> tag found, it proceeds to do what needs to be done (look at the code I gave you again).
I looked at the http://www.laineygossip.com/ page and it seems to have the same structure, with <a> tags (having the link you want) inside <h2> tags.
Starson17 is offline