View Single Post
Old 11-19-2010, 03:09 PM   #10
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
Here's a start:
Spoiler:
Code:
    INDEX = 'http://tsn.ca/nhl/story/?id=nhl'    
    def parse_index(self):
        feeds = []
        soup = self.index_to_soup(self.INDEX)
        feed_parts = soup.findAll('div', attrs={'class': 'feature'})
        for feed_part  in feed_parts:
            feed_title = feed_part.h2.string
            print 'feed_title is: ', feed_title
            article_parts = feed_part.findAll('a')
            print 'article_parts is: ', article_parts
            for article_part in article_parts:
                {build the article list here}
                articles = {the article list}
            if articles:
                feeds.append((feed_title, articles))
        print 'feeds are: ', feeds
        return feeds

This will get the feed title and a soup ("feed_part") that has links and titles for all the articles for that feed.

Last edited by Starson17; 11-19-2010 at 03:21 PM.
Starson17 is offline   Reply With Quote