But all data is obtained.
Retries when response is no data:
def _check_timeline_response(self, r):
if r.status_code == 200 and r.content == b'{"ok":0,"msg":"\\u8fd9\\u91cc\\u8fd8\\u6ca1\\u6709\\u5185\\u5bb9","data":{"cards":[]}}':
# 'No content here yet'. Appears to happen sometimes on pagination, possibly due to too fast requests; retry this
return False, 'no-content message'
if r.status_code != 200:
return False, 'non-200 status code'
return True, None
So, How to set break get_items when it's really no data in response?
This would be a bug, not a question. Please use the correct issue template and include a complete reproducing example (i.e. a user, ideally one with only a few posts).
When I use WeiboUserScraper.get_items():
But all data is obtained. Retries when response is no data:
So, How to set break get_items when it's really no data in response?