Skip to content

Commit

Permalink
Merge pull request #39 from huanghyw/fix_parser_kofail_url
Browse files Browse the repository at this point in the history
Fix parser kofail url
  • Loading branch information
huanghyw authored Dec 22, 2020
2 parents 1e6d2fd + 46f3141 commit 9d82f58
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion jd_spider_requests.py
Original file line number Diff line number Diff line change
Expand Up @@ -577,7 +577,12 @@ def submit_seckill_order(self):
data=self.seckill_order_data.get(
self.sku_id),
headers=headers)
resp_json = parse_json(resp.text)
resp_json = None
try:
resp_json = parse_json(resp.text)
except Exception as e:
logger.info('抢购失败,返回信息:{}'.format(resp.text[0: 128]))
return False
# 返回信息
# 抢购失败:
# {'errorMessage': '很遗憾没有抢到,再接再厉哦。', 'orderId': 0, 'resultCode': 60074, 'skuId': 0, 'success': False}
Expand Down

0 comments on commit 9d82f58

Please sign in to comment.