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 b58a256 commit be9dc80
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion DouBanSpider.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,11 @@ def book_spider(book_tag):

while(1):
url="http://www.douban.com/tag/"+urllib.quote(book_tag)+"/book?start="+str(page_num*15)
source_code = requests.get(url)

try:
source_code = requests.get(url)
except:
continue
time.sleep(0.3)

plain_text = source_code.text
Expand Down

0 comments on commit be9dc80

Please sign in to comment.