myspider.py 文件源码

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

项目:scrapy_tutorials 作者: happyAnger6 项目源码 文件源码
def parse_item(self,response):
        self.logger.info('Hi,this is an item page! %s',response.url)

        item = scrapy.Item()
        item['id'] = response.xpath('//td[@id="item_id"]/text()').re(r'ID: (\d+)')
        item['name'] = response.xpath('//td[@id="item_name"]/text()').extract()
        item['description'] = response.xpath('//td[@id="item_description"]/text()').extract()
        return item
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号