def analyze_loan(url): data, cache = Server.get(url, cache=False, use_cookie=True) if data: info = Analyzer.get_loan_detail(data) if info and info['amount'] < 4000: print url # 判断借款成功次数>0 huanqing = info['tongji_info'].get('total_huanqing') if huanqing and huanqing > 0: # 已还完时间在2016/2之后 if info['lishi_borrowed'] \ and not info['has_buy'] \ and info['tiqian_days'] < -30 \ and len(info['tiqian_days_list']) > 2: print u'买买买' + url if len(info['tiqian_days_list']) > 3 and info['tiqian_days'] < -50: res, msg = PaipaiDai.buy_loan(info['loan_id'], 50) if not res: print u'买买买失败:{0}'.format(msg) else: webbrowser.open_new_tab(url)
def check_loan_qishu(url): data, cache = Server.get(url, cache=False, use_cookie=True) if data: info = Analyzer.get_loan_detail(data) if info: qishu = info['qishu']