Open DaBaiiiii opened 3 years ago
while True: resp = self.sess.get(url=url, headers=headers, params=payload) resp_json = parse_json(resp.text) print('resp_json', resp_json) if resp_json.get('url'): # https://divide.jd.com/user_routing?skuId=8654289&sn=c3f4ececd8461f0e4d7267e96a91e0e0&from=pc router_url = 'https:' + resp_json.get('url') # https://marathon.jd.com/captcha.html?skuId=8654289&sn=c3f4ececd8461f0e4d7267e96a91e0e0&from=pc seckill_url = router_url.replace('divide', 'marathon').replace('user_routing', 'captcha.html') logger.info("抢购链接获取成功: %s", seckill_url) return seckill_url else: logger.info("抢购链接获取失败,%s不是抢购商品或抢购页面暂未刷新,0.1秒后重试", sku_id) time.sleep(0.1)
self.sess.get(url=url, headers=headers, params=payload)返回url为‘’(空字符串)
self.sess.get(url=url, headers=headers, params=payload)返回url为‘’(空字符串)