def get_info(start_num, end_num): global list_items for num in range(start_num, end_num + 1): url = 'p' + str(num) + '/' detail_info = {"p": num} list_items, detail_info = CommonFunc().get_college_detail( url, list_items) print json.dumps(list_items, encoding='UTF-8', ensure_ascii=False), len(list_items.keys())
def get_info(): global list_items list_items, detail_info = CommonFunc().get_student_guide('', list_items) num = 0 for item in copy.deepcopy(list_items).keys(): list_items[item] = CommonFunc().get_news_detail( list_items[item]['url'], list_items[item]) if 'content' not in list_items[item]: list_items[item]['content'] = [] if 'title' not in list_items[item]: list_items[item]['tile'] = '' list_items[item]['desc'] = '' num += 1 print json.dumps(list_items, encoding='UTF-8', ensure_ascii=False), len(list_items.keys())