areas.py 文件源码

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

项目:scrapy-soccerway 作者: tvl 项目源码 文件源码
def parse(self, response):
        l = ItemLoader(item=Area(), response=response)
        l.add_value('id', parse_qs(response.xpath('//div[@class="clearfix subnav level-1"]//li//a[2]/@href').extract()[0])['area_id'][0])
        l.add_xpath('name', '//div[@class="clearfix subnav level-1"]//li//a[2]/text()')
        l.add_value('updated', datetime.utcnow().isoformat()) # you can also use literal values
        return l.load_item()
        #self.log('URL: {}'.format(response.url))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号