pipelines.py 文件源码

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

项目:crawl_web 作者: hanxlinsist 项目源码 文件源码
def process_item(self, item, spider):
        str = ""
        for e in item["bookinfo"]:
            if re.search(r'^\s*$', e):
                print "drop this element"
            else:
                str = str + e + ","
    item["bookinfo"] = str[:-1]

        if item['name']:
            if item['author']:
                return item
            else:
                raise DropItem("Missing name or author in %s" % item)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号