View Single Post
Old 08-18-2012, 09:51 AM   #12
lrui
Enthusiast
lrui ought to be getting tired of karma fortunes by now.lrui ought to be getting tired of karma fortunes by now.lrui ought to be getting tired of karma fortunes by now.lrui ought to be getting tired of karma fortunes by now.lrui ought to be getting tired of karma fortunes by now.lrui ought to be getting tired of karma fortunes by now.lrui ought to be getting tired of karma fortunes by now.lrui ought to be getting tired of karma fortunes by now.lrui ought to be getting tired of karma fortunes by now.lrui ought to be getting tired of karma fortunes by now.lrui ought to be getting tired of karma fortunes by now.
 
lrui's Avatar
 
Posts: 49
Karma: 475062
Join Date: Aug 2012
Device: nook simple touch
Quote:
Originally Posted by Steven630 View Post
Sorry that I've posted so many questions here recently. I'm trying to make a recipe using beautifulsoup. But when I use findAll to find all the articles, only the first article was found. There's otherwise no problem with the recipe

Update: The latest version of Calibre has solved the problem. Many thanks to the author, who fixed the bug and NotTaken, who provided a way to get around the issue in the old version.
I still have this problem like this
Code:
for section in soup.findAll(attrs={'class':['topnews','left','right']}):
              section_title = self.tag_to_string(section.findAll(['span','h2']))
and then i got the error,I dont know why.
AttributeError: 'ResultSet' object has no attribute 'contents'

If I changed section.findAll() into section.find(),it's ok,but only downloaded the first article what was found.

Last edited by lrui; 08-18-2012 at 10:26 AM.
lrui is offline   Reply With Quote