run_spider.py 文件源码

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

项目:rental 作者: meihuanyu 项目源码 文件源码
def runspider(name):
    configure_logging(install_root_handler=False)
    logging.basicConfig(
        filename='log/%s.log' % name,
        format='%(levelname)s %(asctime)s: %(message)s',
        level=logging.DEBUG
    )
    process = CrawlerProcess(get_project_settings())
    try:
        logging.info('runspider start spider:%s' % name)
        process.crawl(name)
        process.start()
    except Exception as e:
        logging.exception('runspider spider:%s exception:%s' % (name, e))

    logging.debug('finish this spider:%s\n\n' % name)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号