View Single Post
Old 03-11-2011, 11:28 AM   #11
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 spedinfargo View Post
Good find! I wonder if there's a way to add some logic to first go here to get the link:

http://sportsillustrated.cnn.com/vau...home/index.htm

It should always be the first link that looks like this:

<div id="ecomthumb_latest_11541"></div>

Is it possible to do a "two-step" process like this?
Yes.
Do something like:
Code:
INDEX2 = 'http://sportsillustrated.cnn.com/vault/cover/home/index.htm'
followed by changing
Code:
soup = self.index_to_soup(self.INDEX)
to
Code:
soup = self.index_to_soup(self.INDEX2)
in parse_index
Than change
Code:
        cover = soup.find('div', attrs = {'alt' : 'Read All Articles', 'style' : 'vertical-align:bottom;'})
        if cover:
            currentIssue = cover.parent['href']
to whatever is needed to produce the currentIssue.

Last edited by Starson17; 03-11-2011 at 11:42 AM.
Starson17 is offline   Reply With Quote