View Single Post
Old 07-24-2013, 09:07 PM   #8
oneillpt
Connoisseur
oneillpt began at the beginning.
 
Posts: 63
Karma: 46
Join Date: Feb 2011
Device: Kindle 3 (cracked screen!); PW1; Oasis
Scientific American still provides content, but the recipe needs a fix:

Replace
Code:
for a in soup.find(attrs={'class':'primaryCol'}).findAll('a',attrs={'title':'Feature'}):
by
Code:
for a in soup.find(attrs={'class':'doubleWide'}).find(attrs={'class':'primaryCol'}).findAll('a',attrs={'title':'Feature'}):
This should be sufficient to get the recipe working again. If you wish you can also clean up articles a little more by replacing the remove_tags by:
Code:
remove_tags = [dict(name='a', attrs={'class':'tinyCommentCount'})
                                ,dict(name='div', attrs={'id':'bigCoverModule'})
                                ,dict(name='div', attrs={'class':'addInfo'})
                                ]
oneillpt is offline   Reply With Quote