sisy_spider.py 文件源码

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

项目:scrapy-image 作者: lamphp 项目源码 文件源码
def parse_item(self, response):

        selector = Selector(response).xpath('//p[@align="center"]')
        for sel in selector:
            image_urls = sel.xpath('a/img/@src').extract()
            path = []
            for img in image_urls:
                path.append(urlparse.urlparse(img).path)

        item = SisyItem()                             
        item['image_urls'] = image_urls
        item['images']     = path

        return item
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号