码迷,mamicode.com
首页 > 其他好文 > 详细

加速scrapy

时间:2017-12-13 11:42:26      阅读:151      评论:0      收藏:0      [点我收藏+]

标签:sel   org   def   color   ext   extra   log   create   dex   

def parse(self, response):
# Get the next index URLs and yield Requests
next_sel = response.xpath(//*[contains(@class,"next")]//@href) for url in next_sel.extract():
yield Request(urlparse.urljoin(response.url, url))

# Iterate through products and create PropertiesItems selectors = response.xpath(
//*[@itemtype="http://schema.org/Product"]) for selector in selectors:
yield self.parse_item(selector, response)

 

加速scrapy

标签:sel   org   def   color   ext   extra   log   create   dex   

原文地址:http://www.cnblogs.com/realmonkeykingsun/p/8031447.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!