Beispiel #1
0
def get_info_once(count, time_now):
    # 基础页面的解析
    base_info_url_dealer = URLDealer(Setting.base_url, Setting.timeout)
    base_info_soup = base_info_url_dealer.get_soup()
    plague_info = PlagueInfo(base_info_soup)

    # 获取全国信息,分省信息,图片url
    detailed_info = plague_info.detailed_info()
    total_info = plague_info.total_info(detailed_info)
    # img_url = plague_info.img_url()

    # 全国信息,分省信息的存储
    mySQL = MySQLSaver(Setting.db)
    save_total_info(mySQL, total_info)
    save_detailed_info(mySQL, detailed_info, count)
    mySQL.close()
Beispiel #2
0
def test_total_info():
    soup = URLDealer(Setting.base_url, Setting.timeout).get_soup()
    plague_info = PlagueInfo(soup)
    detailed_info = plague_info.detailed_info()
    return plague_info.total_info(detailed_info)