ItemLoader

1 def parse(self,response):
2 l = ItemLoader(item = PropertiesItem(),response = response)
3 
4 l.add_xpath('title''// * [@ itemprop =“name”] [1] / text()')l.add_xpath('price''.//*[@itemprop="price“] “'[1] / text()',re ='[,。0-9]+'
5 l.add_xpath('description''// * [@ itemprop =“description”]''[1] / text()'6 l.add_xpath('address''// * [@ itemtype =''“ http://schema.org/Place”] [1] / text()'7 l.add_xpath('image_urls''// * [@ itemprop =“image”] [1] / @ src'8 
9 return load_item()
posted @ 2017-12-13 09:24  不可叽叽歪歪  阅读(124)  评论(0编辑  收藏  举报