After nearly a month of testing candidates, we've finally reached the desired stability to roll out Scrapy 1.0. As announced in the
, 1.0 brings a lot of improvements, but more importantly, it represents an important milestone that marks a new stage of maturity for Scrapy.
You can check our
Release Notes detailing some of the introduced changes, as well as the whole
Changelog in the project's
docs. This little snippet brought up in the first announcement will give you a quick glance of some of those changes:
import scrapy
class MySpider(scrapy.Spider):
# … custom_settings = {
'USER_AGENT': 'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1)',
}
def parse(self, response):
for href in response.xpath(‘//h2/a/@href’).extract():
full_url = response.urljoin(href)
yield scrapy.Response(full_url, callback=self.parse_post)
def parse_post(self, response):
yield {
‘title’: response.xpath(‘//h1’).extract_first(),
‘body’: response.xpath(‘//div.content’).extract_first(),
}
Upgrade to 1.0 by running:
$ pip install --upgrade Scrapy
Since this is a stable release pip will fetch this version anytime Scrapy is installed, unless explicitly told otherwise.
As final note we want to thank all our developers and users again for contributing in shaping up a release we're really proud of, Scrapy's community never ceases to amaze us :)
Happy hacking!