NeteaseSpider.py 文件源码

python
阅读 21 收藏 0 点赞 0 评论 0

项目:neteasenews 作者: tricomm 项目源码 文件源码
def main(startyear=2014, startmonth=1, startday=1, startnewsType=0):
    for year in range(2014, datetime.datetime.now().year + 1):
        if year < startyear:
            continue
        for month in range(1, 13):
            if month < startmonth:
                continue
            for day in range(1, calendar.monthrange(year, month)[1] + 1):
                if day < startday:
                    continue
                pool = multiprocessing.Pool()
                for newsType in range(0, 7):
                    if newsType < startnewsType:
                        continue
                    pool.apply_async(childProcess, args=(year, month, day, newsType))
                pool.close()
                pool.join()
                gc.collect()

## TODO:??????????????
# def restoreProcess():


## TODO:?????????
# def recoveryFromCrash():
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号