View Single Post
Old 06-20-2010, 07:10 AM   #2166
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 kidtwisted View Post
Hey Starson17, help!
I'll take a shot at it

Quote:
I've been having trouble making this work, adding this to the end of the recipe just breaks it.
Does "this" refer to the code below? If so, try this:

Code:
    def postprocess_html(self, soup):
        for tag in soup.findAll('dic', dict(attrs={'class':["article-info clearfix"]})):
            #tag.extract()
            print 'The tag to be extracted is: ', tag
        return soup
If it's breaking because you're extracting something, then you probably shouldn't be extracting it - see what you're extracting with the print code above.

Quote:
Can I get a more detailed example, I did read something about first_fetch but not sure how to use it. Is there another recipe I could look at for example?
The entirety of relevant code is in your example. You find the tag in the soup and extract it. I'm not sure what else to point you to.
Starson17 is offline