加速scrapy

Posted 不可叽叽歪歪

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了加速scrapy相关的知识,希望对你有一定的参考价值。

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的主要内容,如果未能解决你的问题,请参考以下文章