View Single Post
Old 05-07-2009, 05:20 PM   #3
kbfprivate
Junior Member
kbfprivate began at the beginning.
 
Posts: 7
Karma: 10
Join Date: May 2009
Device: ipod touch
It looks like all I need to do is modify this code:

120
def get_current_issue(self):
121 2598
#from urllib2 import urlopen # For some reason mechanize fails
122
#home = urlopen('http://www.newsweek.com').read()
123
soup = self.index_to_soup('http://www.newsweek.com')#BeautifulSoup(home)
124 1182
img = soup.find('img', alt='Current Magazine')
125
if img and img.parent.has_key('href'):
126 2598
return self.index_to_soup(img.parent['href'])

Can I chane "return self.index_to_soup(img.parent['href'])" to be the URL of a previous issue and then re-run the script?

Thanks!
Noah
kbfprivate is offline   Reply With Quote