middlewares.py 文件源码

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

项目:multimedia_crawler 作者: JFluo2011 项目源码 文件源码
def process_request(self, request, spider):
        if self.col.find_one({'$and': [
            {'host': spider.name},
            {'url': request.url},
            # {'download': {'$in': [0, 1, 2]}}
            {'download': {'$ne': -1}},
        ]}):
            logging.warning('the page is crawled, url is {0}'.format(request.url))
            raise IgnoreRequest()

        return None
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号