traffic_jam.py 文件源码

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

项目:QProb 作者: quant-trade 项目源码 文件源码
def handle(self, *args, **options):
        posts = Post.objects.all()

        for post in posts:
            try:
                ref = "{0}{1}/ ".format(settings.DOMAIN, post.slug)
                dict = {'referer': ref}
                dict.update(HEADERS)
                obj = requests.get(post.url, headers=dict)
                if obj.status_code == 200:
                    print((colored.green("OK for: {0}".format(post.url))))
            except Exception as e:
                print((colored.red("[ERROR]: {0}".format(e))))

        self.stdout.write(self.style.SUCCESS('Successfully done parsing jobs'))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号