def create_schemas(): conp = get_conp('jiangxi') arr = [ "dexing", "fengcheng", 'fuzhou', 'ganzhou', 'gaoan', 'jian', 'jiangxi', 'jingdezhen', 'jianggangshan', 'lushan', 'nanchang', 'ruichang', 'ruijin', 'shangrao', 'xinyu', 'yichun', 'yingtan', 'zhangshu' ] for diqu in arr: sql = "create schema if not exists %s" % diqu db_command(sql, dbtype="postgresql", conp=conp)
def task_gaoan(**args): conp = get_conp(gaoan._name_) gaoan.work(conp, **args)
def task_yidu(**args): conp = get_conp(yidu._name_) yidu.work(conp, **args)
def task_enshi(**args): conp = get_conp(enshi._name_) enshi.work(conp, **args)
def task_maanshan(**args): conp = get_conp(maanshan._name_) maanshan.work(conp, cdc_total=None, **args)
def task_huainan(**args): conp = get_conp(huainan._name_) huainan.work(conp, cdc_total=None, **args)
def task_hefei(**args): conp = get_conp(hefei._name_) hefei.work(conp, **args)
def task_chuzhou(**args): conp = get_conp(chuzhou._name_) chuzhou.work(conp, cdc_total=None, **args)
def task_ruichang(**args): conp = get_conp(ruichang._name_) ruichang.work(conp, **args)
def task_nanchang(**args): conp = get_conp(nanchang._name_) nanchang.work(conp, pageloadtimeout=80, **args)
def task_lushan(**args): conp = get_conp(lushan._name_) lushan.work(conp, **args)
def task_jinggangshan(**args): conp = get_conp(jinggangshan._name_) jinggangshan.work(conp, **args)
def task_jingdezhen(**args): conp = get_conp(jingdezhen._name_) jingdezhen.work(conp, **args)
def task_jiangxi(**args): conp = get_conp(jiangxi._name_) jiangxi.work(conp, **args)
def task_jian(**args): conp = get_conp(jian._name_) jian.work(conp, cdc_total=None, **args)
def task_bozhou(**args): conp = get_conp(bozhou._name_) bozhou.work(conp, cdc_total=None, **args)
def task_chaohu(**args): conp = get_conp(chaohu._name_) chaohu.work(conp, **args)
def task_yongchuan(**args): conp = get_conp(yongchuan._name_) yongchuan.work(conp, **args)
def task_fuyang(**args): conp = get_conp(fuyang._name_) fuyang.work(conp, cdc_total=None, **args)
def task_suzhou(**args): conp = get_conp(suzhou._name_, 'anhui') suzhou.work(conp, cdc_total=None, **args)
def task_huaibei(**args): conp = get_conp(huaibei._name_) huaibei.work(conp, cdc_total=None, **args)
def task_tongling(**args): conp = get_conp(tongling._name_) tongling.work(conp, **args)
def task_huangshan(**args): conp = get_conp(huangshan._name_) huangshan.work(conp, **args)
def task_wuhu(**args): conp = get_conp(wuhu._name_) wuhu.work(conp, **args)
def task_dangyang(**args): conp = get_conp(dangyang._name_) dangyang.work(conp, **args)
def task_xuancheng(**args): conp = get_conp(xuancheng._name_) xuancheng.work(conp, **args)
def task_lichuan(**args): conp = get_conp(lichuan._name_) lichuan.work(conp, cdc_total=None, **args)
def task_anqing(**args): conp = get_conp(anqing._name_) anqing.work(conp, **args)
# 包含中标流标 ["zfcg_gg", "http://zbcg.mas.gov.cn/maszbw/jygg/028002/028002003/028002003001/MoreInfo.aspx?CategoryNum=028002003001", ["name", "ggstart_time", "href", "info"], f1, f2], ["zfcg_dyxly_gg", "http://zbcg.mas.gov.cn/maszbw/jygg/028002/028002004/028002004001/MoreInfo.aspx?CategoryNum=028002004001", ["name", "ggstart_time", "href", "info"], f1, f2], ["qsy_yucai_gg", "http://zbcg.mas.gov.cn/maszbw/jygg/028007/028007001/MoreInfo.aspx?CategoryNum=028007001", ["name", "ggstart_time", "href", "info"], f1, f2], ] if gg_existed(conp=get_conp(_name_)): CDC_NUM = 10 else: CDC_NUM = 10000 def work(conp,**args): est_meta(conp,data=data,diqu="安徽省马鞍山市",**args) est_html(conp,f=f3,**args) # CDC_NUM 为增量更新页数,设置成总页数以上(如:10000)可爬全部 # 增量更新时,需将cdc_total设置成 None if __name__=='__main__':
def task_bengbu(**args): conp = get_conp(bengbu._name_) bengbu.work(conp, **args)