Skip to content

Commit

Permalink
Update DouBanSpider.py
Browse files Browse the repository at this point in the history
  • Loading branch information
lanbing510 committed May 20, 2015
1 parent b63df3e commit 5f4ad35
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions DouBanSpider.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ def book_spider(book_tag):
try_times+=1;
if list_soup==None and try_times<200:
continue
elif list_soup==None:
break # Break when no informatoin got after 200 times requesting
elif list_soup==None or len(list_soup)<=1:
break # Break when no valid informatoin got after 200 times requesting

for book_info in list_soup.findAll('dd'):
title = book_info.find('a', {'class':'title'}).string.strip()
Expand Down

0 comments on commit 5f4ad35

Please sign in to comment.