Exemple #1
0
def rainstorm_ES001():
    result = spiderConfig.spiderConfig('rainstorm_ES001')
    if result['status'] == '1':
        frequency = int(result['frequency'])
        global postgreCommand
        postgreCommand = PostgreCommand()
        postgreCommand.connectPostgre()
        try:
            url = 'https://severe.worldweather.wmo.int/thunder'
            infos_paser_One(url)
        except Exception as e:
            print("rainstorm_ES001访问网站失败", str(e))
        postgreCommand.closePostgre()
        timrFor = Timer(frequency * 60 * 60, rainstorm_ES001)
        timrFor.start()
    else:
        print('rainstorm_ES001爬虫停止')
        timrFor = Timer(1 * 60 * 60, rainstorm_ES001)
        timrFor.start()
Exemple #2
0
def rainstorm_ZH002():
    result = spiderConfig.spiderConfig('rainstorm_ZH002')
    if result['status'] == '1':
        frequency = int(result['frequency'])
        delay = int(result['delay'])
        global postgreCommand
        postgreCommand = PostgreCommand()
        postgreCommand.connectPostgre()
        try:
            url = 'http://www.qxkp.net/zhfy/byhl/'
            infos_paser(url,delay)
        except Exception as e:
            print("rainstorm_ZH002访问网站失败", str(e))
        postgreCommand.closePostgre()
        timrFor = Timer(frequency*60*60,rainstorm_ZH002)
        timrFor.start()
    else:
        print('rainstorm_ZH002爬虫停止')
        timrFor = Timer(1*60*60,rainstorm_ZH002)
        timrFor.start()
Exemple #3
0
def stormSurge_ZH004():
    result = spiderConfig.spiderConfig('stormSurge_ZH004')
    if result['status'] == '1':
        frequency = int(result['frequency'])
        delay = int(result['delay'])
        global postgreCommand
        postgreCommand = PostgreCommand()
        postgreCommand.connectPostgre()
        try:
            url = 'https://search.sina.com.cn/?q=%B7%E7%B1%A9%B3%B1&range=title&c=news&sort=time'
            infos_paser(url, delay)
        except Exception as e:
            print("stormSurge_ZH004访问网站失败", str(e))
        postgreCommand.closePostgre()
        timrFor = Timer(frequency * 60 * 60, stormSurge_ZH004)
        timrFor.start()
    else:
        print('stormSurge_ZH004爬虫停止')
        timrFor = Timer(1 * 60 * 60, stormSurge_ZH004)
        timrFor.start()
Exemple #4
0
def thunderstorm_ZH001():
    result = spiderConfig.spiderConfig('thunderstorm_ZH001')
    if result['status'] == '1':
        frequency = int(result['frequency'])
        delay = int(result['delay'])
        global postgreCommand
        postgreCommand = PostgreCommand()
        postgreCommand.connectPostgre()
        try:
            url = 'http://www.tianqi.com/tag/%C0%D7%B1%A9%B4%F3%B7%E7/'
            infos_paser(url,delay)
        except Exception as e:
            print("thunderstorm_ZH001访问网站失败", str(e))
        postgreCommand.closePostgre()
        timrFor = Timer(frequency*60*60,thunderstorm_ZH001)
        timrFor.start()
    else:
        print('thunderstorm_ZH001爬虫停止')
        timrFor = Timer(1*60*60,thunderstorm_ZH001)
        timrFor.start()
Exemple #5
0
def drought_ZH004():
    result = spiderConfig.spiderConfig('drought_ZH004')
    if result['status'] == '1':
        frequency = int(result['frequency'])
        delay = int(result['delay'])
        global postgreCommand
        postgreCommand = PostgreCommand()
        postgreCommand.connectPostgre()
        try:
            url = 'http://so.dzwww.com/web/search?searchscope=DOCTITLE&timescope=&timescopecolumn=&orderby=LIFO&channelid=205667&andsen=&total=&orsen=&exclude=&searchword=%E5%B9%B2%E6%97%B1&perpage=&templet=&token=&timeline='
            infos_paser(url,delay)
        except Exception as e:
            print("drought_ZH004访问网站失败", str(e))
        postgreCommand.closePostgre()
        timrFor = Timer(frequency*60*60,drought_ZH004)
        timrFor.start()
    else:
        print('drought_ZH004爬虫停止')
        timrFor = Timer(1*60*60,drought_ZH004)
        timrFor.start()
Exemple #6
0
def rainstorm_ZH003():
    result = spiderConfig.spiderConfig('rainstorm_ZH003')
    if result['status'] == '1':
        frequency = int(result['frequency'])
        delay = int(result['delay'])
        global postgreCommand
        postgreCommand = PostgreCommand()
        postgreCommand.connectPostgre()
        try:
            url = 'https://www.baidu.com/s?ie=utf-8&cl=2&medium=0&rtt=1&bsst=1&rsv_dl=news_t_sk&tn=news&word=%E6%9A%B4%E9%9B%A8&rsv_sug3=1&rsv_sug4=36&rsv_sug1=1&rsv_sug=1'
            infos_paser(url, delay)
        except Exception as e:
            print("rainstorm_ZH003访问网站失败", str(e))
        postgreCommand.closePostgre()
        timrFor = Timer(frequency * 60 * 60, rainstorm_ZH003)
        timrFor.start()
    else:
        print('rainstorm_ZH003爬虫停止')
        timrFor = Timer(1 * 60 * 60, rainstorm_ZH003)
        timrFor.start()
Exemple #7
0
def drought_ZH003():
    result = spiderConfig.spiderConfig('drought_ZH003')
    if result['status'] == '1':
        frequency = int(result['frequency'])
        delay = int(result['delay'])
        global postgreCommand
        postgreCommand = PostgreCommand()
        postgreCommand.connectPostgre()
        try:
            url = 'https://www.baidu.com/s?rtt=1&bsst=1&cl=2&tn=news&rsv_dl=ns_pc&word=%E5%B9%B2%E6%97%B1'
            infos_paser(url, delay)
        except Exception as e:
            print("drought_ZH003访问网站失败", str(e))
        postgreCommand.closePostgre()
        timrFor = Timer(frequency * 60 * 60, drought_ZH003)
        timrFor.start()
    else:
        print('drought_ZH003爬虫停止')
        timrFor = Timer(1 * 60 * 60, drought_ZH003)
        timrFor.start()
Exemple #8
0
def rainstorm_ZH001():
    result = spiderConfig.spiderConfig('rainstorm_ZH001')
    if result['status'] == '1':
        frequency = int(result['frequency'])
        delay = int(result['delay'])
        global postgreCommand
        postgreCommand = PostgreCommand()
        postgreCommand.connectPostgre()
        try:
            url = 'http://www.cibeicn.com/topic/list.aspx?key=%E6%9A%B4%E9%9B%A8&pageIndex=1'
            infos_paser(url, delay)
        except Exception as e:
            print("rainstorm_ZH001访问网站失败", str(e))
        postgreCommand.closePostgre()
        timrFor = Timer(frequency * 60 * 60, rainstorm_ZH001)
        timrFor.start()
    else:
        print('rainstorm_ZH001爬虫停止')
        timrFor = Timer(1 * 60 * 60, rainstorm_ZH001)
        timrFor.start()
Exemple #9
0
def landslide_ZH006():
    result = spiderConfig.spiderConfig('landslide_ZH006')
    if result['status'] == '1':
        frequency = int(result['frequency'])
        delay = int(result['delay'])
        global postgreCommand
        postgreCommand = PostgreCommand()
        postgreCommand.connectPostgre()
        try:
            url = 'https://search.cctv.com/search.php?qtext=%E6%BB%91%E5%9D%A1&type=web'
            infos_paser(url,delay)
        except Exception as e:
            print("landslide_ZH006访问网站失败", str(e))
        postgreCommand.closePostgre()
        timrFor = Timer(frequency*60*60,landslide_ZH006)
        timrFor.start()
    else:
        print('landslide_ZH006爬虫停止')
        timrFor = Timer(1*60*60,landslide_ZH006)
        timrFor.start()
Exemple #10
0
def stormSurge_ZH005():
    result = spiderConfig.spiderConfig('stormSurge_ZH005')
    if result['status'] == '1':
        frequency = int(result['frequency'])
        delay = int(result['delay'])
        global postgreCommand
        postgreCommand = PostgreCommand()
        postgreCommand.connectPostgre()
        try:
            url = 'https://search.cctv.com/search.php?qtext=%E9%A3%8E%E6%9A%B4%E6%BD%AE&type=web'
            infos_paser(url, delay)
        except Exception as e:
            print("stormSurge_ZH005访问网站失败", str(e))
        postgreCommand.closePostgre()
        timrFor = Timer(frequency * 60 * 60, stormSurge_ZH005)
        timrFor.start()
    else:
        print('stormSurge_ZH005爬虫停止')
        timrFor = Timer(1 * 60 * 60, stormSurge_ZH005)
        timrFor.start()
Exemple #11
0
def forestFire_ZH005():
    result = spiderConfig.spiderConfig('forestFire_ZH005')
    if result['status'] == '1':
        frequency = int(result['frequency'])
        delay = int(result['delay'])
        global postgreCommand
        postgreCommand = PostgreCommand()
        postgreCommand.connectPostgre()
        try:
            url = 'http://www.tianqi.com/tag/%C9%AD%C1%D6%BB%F0%D4%D6/'
            infos_paser(url, delay)
        except Exception as e:
            print("forestFire_ZH005访问网站失败", str(e))
        postgreCommand.closePostgre()
        timrFor = Timer(frequency * 60 * 60, forestFire_ZH005)
        timrFor.start()
    else:
        print('forestFire_ZH005爬虫停止')
        timrFor = Timer(1 * 60 * 60, forestFire_ZH005)
        timrFor.start()
Exemple #12
0
def forestFire_ZH001():
    result = spiderConfig.spiderConfig('forestFire_ZH001')
    if result['status'] == '1':
        frequency = int(result['frequency'])
        delay = int(result['delay'])
        global postgreCommand
        postgreCommand = PostgreCommand()
        postgreCommand.connectPostgre()
        try:
            url = 'http://www.cibeicn.com/topic/list.aspx?key=%E6%A3%AE%E6%9E%97%E7%81%AB%E7%81%BE'
            infos_paser(url,delay)
        except Exception as e:
            print("forestFire_ZH001访问网站失败", str(e))
        postgreCommand.closePostgre()
        timrFor = Timer(frequency*60*60,forestFire_ZH001)
        timrFor.start()
    else:
        print('forestFire_ZH001爬虫停止')
        timrFor = Timer(1*60*60,forestFire_ZH001)
        timrFor.start()
Exemple #13
0
def typhoon_ZH005():
    result = spiderConfig.spiderConfig('typhoon_ZH005')
    if result['status'] == '1':
        frequency = int(result['frequency'])
        delay = int(result['delay'])
        global postgreCommand
        postgreCommand = PostgreCommand()
        postgreCommand.connectPostgre()
        try:
            url = 'https://www.baidu.com/s?rtt=1&bsst=1&cl=undefined&tn=news&rsv_dl=ns_pc&word=%E5%8F%B0%E9%A3%8E%E6%9C%80%E6%96%B0%E6%B6%88%E6%81%AF&x_bfe_rqs=03E80&x_bfe_tjscore=0.001476&tngroupname=organic_news&pn=0'
            infos_paser(url, delay)
        except Exception as e:
            print("typhoon_ZH005访问网站失败", str(e))
        postgreCommand.closePostgre()
        timrFor = Timer(frequency * 60 * 60, typhoon_ZH005)
        timrFor.start()
    else:
        print('typhoon_ZH005爬虫停止')
        timrFor = Timer(1 * 60 * 60, typhoon_ZH005)
        timrFor.start()
def comprehensive_ZH001():
    result = spiderConfig.spiderConfig('comprehensive_ZH001')
    if result['status'] == '1':
        frequency = int(result['frequency'])
        delay = int(result['delay'])
        global postgreCommand
        postgreCommand = PostgreCommand()
        postgreCommand.connectPostgre()
        try:
            url = 'http://japan.people.com.cn/GB/35467/387511/index.html'
            infos_paser(url, delay)
        except Exception as e:
            print("comprehensive_ZH001访问网站失败", str(e))
        postgreCommand.closePostgre()
        timrFor = Timer(frequency * 60 * 60, comprehensive_ZH001)
        timrFor.start()
    else:
        print('comprehensive_ZH001爬虫停止')
        timrFor = Timer(1 * 60 * 60, comprehensive_ZH001)
        timrFor.start()
Exemple #15
0
def debrisFlow_ZH004():
    result = spiderConfig.spiderConfig('debrisFlow_ZH004')
    if result['status'] == '1':
        frequency = int(result['frequency'])
        delay = int(result['delay'])
        global postgreCommand
        postgreCommand = PostgreCommand()
        postgreCommand.connectPostgre()
        try:
            url = 'https://search.sina.com.cn/?q=%C4%E0%CA%AF%C1%F7%D4%D6%BA%A6&range=title&c=news&sort=time'
            infos_paser(url,delay)
        except Exception as e:
            print("debrisFlow_ZH004访问网站失败", str(e))
        postgreCommand.closePostgre()
        timrFor = Timer(frequency*60*60,debrisFlow_ZH004)
        timrFor.start()
    else:
        print('debrisFlow_ZH004爬虫停止')
        timrFor = Timer(1*60*60,debrisFlow_ZH004)
        timrFor.start()
Exemple #16
0
def landslide_ZH002():
    result = spiderConfig.spiderConfig('landslide_ZH002')
    if result['status'] == '1':
        frequency = int(result['frequency'])
        delay = int(result['delay'])
        global postgreCommand
        postgreCommand = PostgreCommand()
        postgreCommand.connectPostgre()
        try:
            url = 'https://www.baidu.com/s?rtt=1&bsst=1&cl=2&tn=news&rsv_dl=ns_pc&word=%E6%BB%91%E5%9D%A1'
            infos_paser(url, delay)
        except Exception as e:
            print("landslide_ZH002访问网站失败", str(e))
        postgreCommand.closePostgre()
        timrFor = Timer(frequency * 60 * 60, landslide_ZH002)
        timrFor.start()
    else:
        print('landslide_ZH002爬虫停止')
        timrFor = Timer(1 * 60 * 60, landslide_ZH002)
        timrFor.start()
Exemple #17
0
def heavyFog_ZH001():
    result = spiderConfig.spiderConfig('heavyFog_ZH001')
    if result['status'] == '1':
        frequency = int(result['frequency'])
        delay = int(result['delay'])
        global postgreCommand
        postgreCommand = PostgreCommand()
        postgreCommand.connectPostgre()
        try:
            url = 'http://www.tianqi.com/tag/%B4%F3%CE%ED%CC%EC%C6%F8/'
            infos_paser(url, delay)
        except Exception as e:
            print("heavyFog_ZH001访问网站失败", str(e))
        postgreCommand.closePostgre()
        timrFor = Timer(frequency * 60 * 60, heavyFog_ZH001)
        timrFor.start()
    else:
        print('heavyFog_ZH001爬虫停止')
        timrFor = Timer(1 * 60 * 60, heavyFog_ZH001)
        timrFor.start()
Exemple #18
0
def earthquake_ES001():
    result = spiderConfig.spiderConfig('earthquake_ES001')
    if result['status'] == '1':
        frequency = int(result['frequency'])
        delay = int(result['delay'])
        global postgreCommand
        postgreCommand = PostgreCommand()
        postgreCommand.connectPostgre()
        try:
            url = 'https://earthquake.usgs.gov/earthquakes/feed/v1.0/summary/2.5_day.geojson'
            infos_paser(url, delay)
        except Exception as e:
            print("earthquake_ES001访问网站失败", str(e))
        postgreCommand.closePostgre()
        timrFor = Timer(frequency * 60 * 60, earthquake_ES001)
        timrFor.start()
    else:
        print('earthquake_ES001爬虫停止')
        timrFor = Timer(1 * 60 * 60, earthquake_ES001)
        timrFor.start()
Exemple #19
0
def debrisFlow_ZH001():
    result = spiderConfig.spiderConfig('debrisFlow_ZH001')
    if result['status'] == '1':
        frequency = int(result['frequency'])
        delay = int(result['delay'])
        global postgreCommand
        postgreCommand = PostgreCommand()
        postgreCommand.connectPostgre()
        try:
            url = 'https://search.cctv.com/search.php?qtext=%E6%B3%A5%E7%9F%B3%E6%B5%81&type=web'
            infos_paser(url, delay)
        except Exception as e:
            print("debrisFlow_ZH001访问网站失败", str(e))
        postgreCommand.closePostgre()
        timrFor = Timer(frequency * 60 * 60, debrisFlow_ZH001)
        timrFor.start()
    else:
        print('debrisFlow_ZH001爬虫停止')
        timrFor = Timer(1 * 60 * 60, debrisFlow_ZH001)
        timrFor.start()
Exemple #20
0
def forestFire_ZH006():
    result = spiderConfig.spiderConfig('forestFire_ZH006')
    if result['status'] == '1':
        frequency = int(result['frequency'])
        delay = int(result['delay'])
        global postgreCommand
        postgreCommand = PostgreCommand()
        postgreCommand.connectPostgre()
        try:
            url = 'https://search.cctv.com/search.php?qtext=%E6%A3%AE%E6%9E%97%E7%81%AB%E7%81%BE&type=web'
            infos_paser(url, delay)
        except Exception as e:
            print("forestFire_ZH006访问网站失败", str(e))
        postgreCommand.closePostgre()
        timrFor = Timer(frequency * 60 * 60, forestFire_ZH006)
        timrFor.start()
    else:
        print('forestFire_ZH006爬虫停止')
        timrFor = Timer(1 * 60 * 60, forestFire_ZH006)
        timrFor.start()
Exemple #21
0
def earthquake_ES002():
    result = spiderConfig.spiderConfig('earthquake_ES002')
    if result['status'] == '1':
        frequency = int(result['frequency'])
        delay = int(result['delay'])
        global postgreCommand
        postgreCommand = PostgreCommand()
        postgreCommand.connectPostgre()
        try:
            url = 'http://ds.iris.edu/seismon/eventlist/index.phtml'
            infos_paser(url, delay)
        except Exception as e:
            print("earthquake_ES002访问网站失败", str(e))
        postgreCommand.closePostgre()
        timrFor = Timer(frequency * 60 * 60, earthquake_ES002)
        timrFor.start()
    else:
        print('earthquake_ES002爬虫停止')
        timrFor = Timer(1 * 60 * 60, earthquake_ES002)
        timrFor.start()
Exemple #22
0
def tsunami_ZH002():
    result = spiderConfig.spiderConfig('tsunami_ZH002')
    if result['status'] == '1':
        frequency = int(result['frequency'])
        delay = int(result['delay'])
        global postgreCommand
        postgreCommand = PostgreCommand()
        postgreCommand.connectPostgre()
        try:
            url = 'https://www.baidu.com/s?tn=news&rtt=1&bsst=1&cl=2&wd=%E6%B5%B7%E5%95%B8&medium=0'
            infos_paser(url, delay)
        except Exception as e:
            print("tsunami_ZH002访问网站失败", str(e))
        postgreCommand.closePostgre()
        timrFor = Timer(frequency * 60 * 60, tsunami_ZH002)
        timrFor.start()
    else:
        print('tsunami_ZH002爬虫停止')
        timrFor = Timer(1 * 60 * 60, tsunami_ZH002)
        timrFor.start()
Exemple #23
0
def typhoon_ZH002():
    result = spiderConfig.spiderConfig('typhoon_ZH002')
    if result['status'] == '1':
        frequency = int(result['frequency'])
        delay = int(result['delay'])
        global postgreCommand
        postgreCommand = PostgreCommand()
        postgreCommand.connectPostgre()
        try:
            url = 'https://search.sina.com.cn/?q=%CC%A8%B7%E7%D4%D6%BA%A6&range=title&c=news&sort=time'
            infos_paser(url, delay)
        except Exception as e:
            print("typhoon_ZH002访问网站失败", str(e))
        postgreCommand.closePostgre()
        timrFor = Timer(frequency * 60 * 60, typhoon_ZH002)
        timrFor.start()
    else:
        print('typhoon_ZH002爬虫停止')
        timrFor = Timer(1 * 60 * 60, typhoon_ZH002)
        timrFor.start()
Exemple #24
0
def coldWave_ZH001():
    result = spiderConfig.spiderConfig('coldWave_ZH001')
    if result['status'] == '1':
        frequency = int(result['frequency'])
        delay = int(result['delay'])
        global postgreCommand
        postgreCommand = PostgreCommand()
        postgreCommand.connectPostgre()
        try:
            url = 'http://www.tianqi.com/tag/%BA%AE%B3%B1/'
            infos_paser(url, delay)
        except Exception as e:
            print("coldWave_ZH001访问网站失败", str(e))
        postgreCommand.closePostgre()
        timrFor = Timer(frequency * 60 * 60, coldWave_ZH001)
        timrFor.start()
    else:
        print('coldWave_ZH001爬虫停止')
        timrFor = Timer(1 * 60 * 60, coldWave_ZH001)
        timrFor.start()
Exemple #25
0
def drought_ZH005():
    result = spiderConfig.spiderConfig('drought_ZH005')
    if result['status'] == '1':
        frequency = int(result['frequency'])
        delay = int(result['delay'])
        global postgreCommand
        postgreCommand = PostgreCommand()
        postgreCommand.connectPostgre()
        try:
            url = 'https://search.sina.com.cn/?q=%B8%C9%BA%B5&range=title&c=news&sort=rel&col=&source=&from=&country=&size=&time=&a=&t='
            infos_paser(url, delay)
        except Exception as e:
            print("drought_ZH005访问网站失败", str(e))
        postgreCommand.closePostgre()
        timrFor = Timer(frequency * 60 * 60, drought_ZH005)
        timrFor.start()
    else:
        print('drought_ZH005爬虫停止')
        timrFor = Timer(1 * 60 * 60, drought_ZH005)
        timrFor.start()
Exemple #26
0
def stormSurge_ZH001():
    result = spiderConfig.spiderConfig('stormSurge_ZH001')
    if result['status'] == '1':
        frequency = int(result['frequency'])
        delay = int(result['delay'])
        global postgreCommand
        postgreCommand = PostgreCommand()
        postgreCommand.connectPostgre()
        try:
            url = 'http://www.oceanguide.org.cn/hyyj/map/boreList.htm?type=storm'
            infos_paser(url, delay)
        except Exception as e:
            print("stormSurge_ZH001访问网站失败", str(e))
        postgreCommand.closePostgre()
        timrFor = Timer(frequency * 60 * 60, stormSurge_ZH001)
        timrFor.start()
    else:
        print('stormSurge_ZH001爬虫停止')
        timrFor = Timer(1 * 60 * 60, stormSurge_ZH001)
        timrFor.start()
Exemple #27
0
def collapse_ZH003():
    result = spiderConfig.spiderConfig('collapse_ZH003')
    if result['status'] == '1':
        frequency = int(result['frequency'])
        delay = int(result['delay'])
        global postgreCommand
        postgreCommand = PostgreCommand()
        postgreCommand.connectPostgre()
        try:
            url = 'https://www.baidu.com/s?tn=news&rtt=4&bsst=1&cl=2&wd=%E5%B1%B1%E4%BD%93%E5%B4%A9%E5%A1%8C&medium=0'
            infos_paser(url, delay)
        except Exception as e:
            print("collapse_ZH003访问网站失败", str(e))
        postgreCommand.closePostgre()
        timrFor = Timer(frequency * 60 * 60, collapse_ZH003)
        timrFor.start()
    else:
        print('collapse_ZH003爬虫停止')
        timrFor = Timer(1 * 60 * 60, collapse_ZH003)
        timrFor.start()
Exemple #28
0
def collapse_ZH001(tm):
    result = spiderConfig.spiderConfig('collapse_ZH001')
    if result['status'] == '1':
        frequency = int(result['frequency'])
        delay = int(result['delay'])
        global postgreCommand
        postgreCommand = PostgreCommand()
        postgreCommand.connectPostgre()
        try:
            url = 'https://search.cctv.com/search.php?qtext=%E5%B1%B1%E4%BD%93%E5%B4%A9%E5%A1%8C&type=web#'
            infos_paser(url,delay)
        except Exception as e:
            print("collapse_ZH001访问网站失败", str(e))
        postgreCommand.closePostgre()
        timrFor = Timer(frequency*60*60,collapse_ZH001)
        timrFor.start()
    else:
        print('collapse_ZH001爬虫停止')
        timrFor = Timer(1*60*60,collapse_ZH001)
        timrFor.start()
Exemple #29
0
def rainstorm_ZH006():
    result = spiderConfig.spiderConfig('rainstorm_ZH006')
    if result['status'] == '1':
        frequency = int(result['frequency'])
        delay = int(result['delay'])
        global postgreCommand
        postgreCommand = PostgreCommand()
        postgreCommand.connectPostgre()
        try:
            url = 'http://www.tianqi.com/tag/%B1%A9%D3%EA/'
            infos_paser(url, delay)
        except Exception as e:
            print("rainstorm_ZH006访问网站失败", str(e))
        postgreCommand.closePostgre()
        timrFor = Timer(frequency * 60 * 60, rainstorm_ZH006)
        timrFor.start()
    else:
        print('rainstorm_ZH006爬虫停止')
        timrFor = Timer(1 * 60 * 60, rainstorm_ZH006)
        timrFor.start()
Exemple #30
0
def typhoon_ZH004():
    result = spiderConfig.spiderConfig('typhoon_ZH004')
    if result['status'] == '1':
        frequency = int(result['frequency'])
        delay = int(result['delay'])
        global postgreCommand
        postgreCommand = PostgreCommand()
        postgreCommand.connectPostgre()
        try:
            url = 'http://www.tianqi.com/tag/%CC%A8%B7%E7%D7%EE%D0%C2%CF%FB%CF%A2/'
            infos_paser(url, delay)
        except Exception as e:
            print("typhoon_ZH004访问网站失败", str(e))
        postgreCommand.closePostgre()
        timrFor = Timer(frequency * 60 * 60, typhoon_ZH004)
        timrFor.start()
    else:
        print('typhoon_ZH004爬虫停止')
        timrFor = Timer(1 * 60 * 60, typhoon_ZH004)
        timrFor.start()