Skip to content

Commit

Permalink
更新加载中断条件
Browse files Browse the repository at this point in the history
  • Loading branch information
staugur committed May 25, 2018
1 parent f83da01 commit 03de021
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions grab_huaban_board.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ def _crawl_board(board_id):
else:
board_pins += board_next_data["pins"]
printcolor("ajax load board with pin_id {}, get pins number is {}, merged".format(last_pin, len(board_next_data["pins"])), "blue")
if len(board_next_data["pins"]) < limit:
if len(board_next_data["pins"]) == 0:
break
last_pin = board_next_data["pins"][-1]["pin_id"]
retry -= 1
Expand Down Expand Up @@ -163,7 +163,7 @@ def _crawl_user(user_id):
else:
board_ids += user_next_data["boards"]
printcolor("ajax load user with board_id {}, get boards number is {}, merged".format(last_board, len(user_next_data["boards"])), "blue")
if len(user_next_data["boards"]) < limit:
if len(user_next_data["boards"]) == 0:
break
last_board = user_next_data["boards"][-1]["board_id"]
retry -= 1
Expand Down

0 comments on commit 03de021

Please sign in to comment.