pipelines.py 文件源码

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

项目:NCspider 作者: build2last 项目源码 文件源码
def from_crawler(cls, crawler):
        settings = crawler.settings
        kw = dict(
            host=settings.get('MYSQL_HOST',' localhost'),
            port=settings.get('MYSQL_PORT', 3306),
            user=settings.get('MYSQL_USER', 'root'),
            db=settings.get('MYSQL_DB', 'test'),
            passwd=settings.get('MYSQL_PASSWD'),
            charset='utf8',
            use_unicode=True,
        )
        dbpool = adbapi.ConnectionPool ('MySQLdb', **kw)
        return cls (dbpool)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号