Scrapy 1.4 does not bring that many breathtaking new features but quite a few handy improvements nonetheless.
Scrapy now supports anonymous FTP sessions with customizable user and password via the new FTP_USER
and FTP_PASSWORD
settings. And if you're using Twisted version 17.1.0 or above, FTP is now available with Python 3.
There's a new response.follow <scrapy.http.TextResponse.follow>
method for creating requests; it is now a recommended way to create Requests in Scrapy spiders. This method makes it easier to write correct spiders; response.follow
has several advantages over creating scrapy.Request
objects directly:
- it handles relative URLs;
- it works properly with non-ascii URLs on non-UTF8 pages;
- in addition to absolute and relative URLs it supports Selectors; for
<a>
elements it can also extract their href values.
For example, instead of this:
for href in response.css('li.page a::attr(href)').extract():
url = response.urljoin(href)
yield scrapy.Request(url, self.parse, encoding=response.encoding)
One can now write this:
for a in response.css('li.page a'):
yield response.follow(a, self.parse)
Link extractors are also improved. They work similarly to what a regular modern browser would do: leading and trailing whitespace are removed from attributes (think href=" http://example.com"
) when building Link
objects. This whitespace-stripping also happens for action
attributes with FormRequest
.
Please also note that link extractors do not canonicalize URLs by default anymore. This was puzzling users every now and then, and it's not what browsers do in fact, so we removed that extra transformation on extractred links.
For those of you wanting more control on the Referer:
header that Scrapy sends when following links, you can set your own Referrer Policy
. Prior to Scrapy 1.4, the default RefererMiddleware
would simply and blindly set it to the URL of the response that generated the HTTP request (which could leak information on your URL seeds). By default, Scrapy now behaves much like your regular browser does. And this policy is fully customizable with W3C standard values (or with something really custom of your own if you wish). See REFERRER_POLICY
for details.
To make Scrapy spiders easier to debug, Scrapy logs more stats by default in 1.4: memory usage stats, detailed retry stats, detailed HTTP error code stats. A similar change is that HTTP cache path is also visible in logs now.
Last but not least, Scrapy now has the option to make JSON and XML items more human-readable, with newlines between items and even custom indenting offset, using the new FEED_EXPORT_INDENT
setting.
Enjoy! (Or read on for the rest of changes in this release.)
- Default to
canonicalize=False
inscrapy.linkextractors.LinkExtractor
(2537
, fixes1941
and1982
): warning, this is technically backwards-incompatible - Enable memusage extension by default (
2539
, fixes2187
); this is technically backwards-incompatible so please check if you have any non-defaultMEMUSAGE_***
options set. EDITOR
environment variable now takes precedence overEDITOR
option defined in settings.py (1829
); Scrapy default settings no longer depend on environment variables. This is technically a backwards incompatible change.Spider.make_requests_from_url
is deprecated (1728
, fixes1495
).
- Accept proxy credentials in
proxy
request meta key (2526
) - Support brotli-compressed content; requires optional brotlipy (
2535
) - New
response.follow <response-follow-example>
shortcut for creating requests (1940
) - Added
flags
argument and attribute toRequest <scrapy.http.Request>
objects (2047
) - Support Anonymous FTP (
2342
) - Added
retry/count
,retry/max_reached
andretry/reason_count/<reason>
stats toRetryMiddleware <scrapy.downloadermiddlewares.retry.RetryMiddleware>
(2543
) - Added
httperror/response_ignored_count
andhttperror/response_ignored_status_count/<status>
stats toHttpErrorMiddleware <scrapy.spidermiddlewares.httperror.HttpErrorMiddleware>
(2566
) - Customizable
Referrer policy <REFERRER_POLICY>
inRefererMiddleware <scrapy.spidermiddlewares.referer.RefererMiddleware>
(2306
) - New
data:
URI download handler (2334
, fixes2156
) - Log cache directory when HTTP Cache is used (
2611
, fixes2604
) - Warn users when project contains duplicate spider names (fixes
2181
) CaselessDict
now acceptsMapping
instances and not only dicts (2646
)Media downloads <topics-media-pipeline>
, withFilesPipelines
orImagesPipelines
, can now optionally handle HTTP redirects using the newMEDIA_ALLOW_REDIRECTS
setting (2616
, fixes2004
)- Accept non-complete responses from websites using a new
DOWNLOAD_FAIL_ON_DATALOSS
setting (2590
, fixes2586
) - Optional pretty-printing of JSON and XML items via
FEED_EXPORT_INDENT
setting (2456
, fixes1327
) - Allow dropping fields in
FormRequest.from_response
formdata whenNone
value is passed (667
) - Per-request retry times with the new
max_retry_times
meta key (2642
) python -m scrapy
as a more explicit alternative toscrapy
command (2740
)
- LinkExtractor now strips leading and trailing whitespaces from attributes (
2547
, fixes1614
) - Properly handle whitespaces in action attribute in
FormRequest
(2548
) - Buffer CONNECT response bytes from proxy until all HTTP headers are received (
2495
, fixes2491
) - FTP downloader now works on Python 3, provided you use Twisted>=17.1 (
2599
) - Use body to choose response type after decompressing content (
2393
, fixes2145
) - Always decompress
Content-Encoding: gzip
atHttpCompressionMiddleware <scrapy.downloadermiddlewares.httpcompression.HttpCompressionMiddleware>
stage (2391
) - Respect custom log level in
Spider.custom_settings
(2581
, fixes1612
) - 'make htmlview' fix for macOS (
2661
) - Remove "commands" from the command list (
2695
) - Fix duplicate Content-Length header for POST requests with empty body (
2677
) - Properly cancel large downloads, i.e. above
DOWNLOAD_MAXSIZE
(1616
) - ImagesPipeline: fixed processing of transparent PNG images with palette (
2675
)
- Tests: remove temp files and folders (
2570
), fixed ProjectUtilsTest on OS X (2569
), use portable pypy for Linux on Travis CI (2710
) - Separate building request from
_requests_to_follow
in CrawlSpider (2562
) - Remove “Python 3 progress” badge (
2567
) - Add a couple more lines to
.gitignore
(2557
) - Remove bumpversion prerelease configuration (
2159
) - Add codecov.yml file (
2750
) - Set context factory implementation based on Twisted version (
2577
, fixes2560
) - Add omitted
self
arguments in default project middleware template (2595
) - Remove redundant
slot.add_request()
call in ExecutionEngine (2617
) - Catch more specific
os.error
exception inFSFilesStore
(2644
) - Change "localhost" test server certificate (
2720
) - Remove unused
MEMUSAGE_REPORT
setting (2576
)
- Binary mode is required for exporters (
2564
, fixes2553
) - Mention issue with
FormRequest.from_response <scrapy.http.FormRequest.from_response>
due to bug in lxml (2572
) - Use single quotes uniformly in templates (
2596
) - Document
ftp_user
andftp_password
meta keys (2587
) - Removed section on deprecated
contrib/
(2636
) - Recommend Anaconda when installing Scrapy on Windows (
2477
, fixes2475
) - FAQ: rewrite note on Python 3 support on Windows (
2690
) - Rearrange selector sections (
2705
) - Remove
__nonzero__
fromSelectorList
docs (2683
) - Mention how to disable request filtering in documentation of
DUPEFILTER_CLASS
setting (2714
) - Add sphinx_rtd_theme to docs setup readme (
2668
) - Open file in text mode in JSON item writer example (
2729
) - Clarify
allowed_domains
example (2670
)
- Make
SpiderLoader
raiseImportError
again by default for missing dependencies and wrongSPIDER_MODULES
. These exceptions were silenced as warnings since 1.3.0. A new setting is introduced to toggle between warning or exception if needed ; seeSPIDER_LOADER_WARN_ONLY
for details.
- Preserve request class when converting to/from dicts (utils.reqser) (
2510
). - Use consistent selectors for author field in tutorial (
2551
). - Fix TLS compatibility in Twisted 17+ (
2558
)
- Support
'True'
and'False'
string values for boolean settings (2519
); you can now do something likescrapy crawl myspider -s REDIRECT_ENABLED=False
. - Support kwargs with
response.xpath()
to useXPath variables <topics-selectors-xpath-variables>
and ad-hoc namespaces declarations ; this requires at least Parsel v1.1 (2457
). - Add support for Python 3.6 (
2485
). - Run tests on PyPy (warning: some tests still fail, so PyPy is not supported yet).
- Enforce
DNS_TIMEOUT
setting (2496
). - Fix
view
command ; it was a regression in v1.3.0 (2503
). - Fix tests regarding
*_EXPIRES settings
with Files/Images pipelines (2460
). - Fix name of generated pipeline class when using basic project template (
2466
). - Fix compatiblity with Twisted 17+ (
2496
,2528
). - Fix
scrapy.Item
inheritance on Python 3.6 (2511
). - Enforce numeric values for components order in
SPIDER_MIDDLEWARES
,DOWNLOADER_MIDDLEWARES
,EXTENIONS
andSPIDER_CONTRACTS
(2420
).
- Reword Code of Coduct section and upgrade to Contributor Covenant v1.4 (
2469
). - Clarify that passing spider arguments converts them to spider attributes (
2483
). - Document
formid
argument onFormRequest.from_response()
(2497
). - Add .rst extension to README files (
2507
). - Mention LevelDB cache storage backend (
2525
). - Use
yield
in sample callback code (2533
). - Add note about HTML entities decoding with
.re()/.re_first()
(1704
). - Typos (
2512
,2534
,2531
).
- Remove reduntant check in
MetaRefreshMiddleware
(2542
). - Faster checks in
LinkExtractor
for allow/deny patterns (2538
). - Remove dead code supporting old Twisted versions (
2544
).
This release comes rather soon after 1.2.2 for one main reason: it was found out that releases since 0.18 up to 1.2.2 (included) use some backported code from Twisted (scrapy.xlib.tx.*
), even if newer Twisted modules are available. Scrapy now uses twisted.web.client
and twisted.internet.endpoints
directly. (See also cleanups below.)
As it is a major change, we wanted to get the bug fix out quickly while not breaking any projects using the 1.2 series.
MailSender
now accepts single strings as values forto
andcc
arguments (2272
)scrapy fetch url
,scrapy shell url
andfetch(url)
inside scrapy shell now follow HTTP redirections by default (2290
); Seefetch
andshell
for details.HttpErrorMiddleware
now logs errors withINFO
level instead ofDEBUG
; this is technically backwards incompatible so please check your log parsers.- By default, logger names now use a long-form path, e.g.
[scrapy.extensions.logstats]
, instead of the shorter "top-level" variant of prior releases (e.g.[scrapy]
); this is backwards incompatible if you have log parsers expecting the short logger name part. You can switch back to short logger names usingLOG_SHORT_NAMES
set toTrue
.
- Scrapy now requires Twisted >= 13.1 which is the case for many Linux distributions already.
- As a consequence, we got rid of
scrapy.xlib.tx.*
modules, which copied some of Twisted code for users stuck with an "old" Twisted version ChunkedTransferMiddleware
is deprecated and removed from the default downloader middlewares.
- Packaging fix: disallow unsupported Twisted versions in setup.py
- Fix a cryptic traceback when a pipeline fails on
open_spider()
(2011
) - Fix embedded IPython shell variables (fixing
396
that re-appeared in 1.2.0, fixed in2418
) - A couple of patches when dealing with robots.txt:
- handle (non-standard) relative sitemap URLs (
2390
) - handle non-ASCII URLs and User-Agents in Python 2 (
2373
)
- handle (non-standard) relative sitemap URLs (
- Document
"download_latency"
key inRequest
'smeta
dict (2033
) - Remove page on (deprecated & unsupported) Ubuntu packages from ToC (
2335
) - A few fixed typos (
2346
,2369
,2369
,2380
) and clarifications (2354
,2325
,2414
)
- Advertize conda-forge as Scrapy's official conda channel (
2387
) - More helpful error messages when trying to use
.css()
or.xpath()
on non-Text Responses (2264
) startproject
command now generates a samplemiddlewares.py
file (2335
)- Add more dependencies' version info in
scrapy version
verbose output (2404
) - Remove all
*.pyc
files from source distribution (2386
)
- Include OpenSSL's more permissive default ciphers when establishing TLS/SSL connections (
2314
). - Fix "Location" HTTP header decoding on non-ASCII URL redirects (
2321
).
- Fix JsonWriterPipeline example (
2302
). - Various notes:
2330
on spider names,2329
on middleware methods processing order,2327
on getting multi-valued HTTP headers as lists.
- Removed
www.
fromstart_urls
in built-in spider templates (2299
).
- New
FEED_EXPORT_ENCODING
setting to customize the encoding used when writing items to a file. This can be used to turn off\uXXXX
escapes in JSON output. This is also useful for those wanting something else than UTF-8 for XML or CSV output (2034
). startproject
command now supports an optional destination directory to override the default one based on the project name (2005
).- New
SCHEDULER_DEBUG
setting to log requests serialization failures (1610
). - JSON encoder now supports serialization of
set
instances (2058
). - Interpret
application/json-amazonui-streaming
asTextResponse
(1503
). scrapy
is imported by default when using shell tools (shell
,inspect_response <topics-shell-inspect-response>
) (2248
).
- DefaultRequestHeaders middleware now runs before UserAgent middleware (
2088
). Warning: this is technically backwards incompatible, though we consider this a bug fix. - HTTP cache extension and plugins that use the
.scrapy
data directory now work outside projects (1581
). Warning: this is technically backwards incompatible, though we consider this a bug fix. Selector
does not allow passing bothresponse
andtext
anymore (2153
).- Fixed logging of wrong callback name with
scrapy parse
(2169
). - Fix for an odd gzip decompression bug (
1606
). - Fix for selected callbacks when using
CrawlSpider
withscrapy parse <parse>
(2225
). - Fix for invalid JSON and XML files when spider yields no items (
872
). - Implement
flush()
fprStreamLogger
avoiding a warning in logs (2125
).
canonicalize_url
has been moved to w3lib.url (2168
).
Scrapy's new requirements baseline is Debian 8 "Jessie". It was previously Ubuntu 12.04 Precise. What this means in practice is that we run continuous integration tests with these (main) packages versions at a minimum: Twisted 14.0, pyOpenSSL 0.14, lxml 3.4.
Scrapy may very well work with older versions of these packages (the code base still has switches for older Twisted versions for example) but it is not guaranteed (because it's not tested anymore).
- Grammar fixes:
2128
,1566
. - Download stats badge removed from README (
2160
). - New scrapy
architecture diagram <topics-architecture>
(2165
). - Updated
Response
parameters documentation (2197
). - Reworded misleading
RANDOMIZE_DOWNLOAD_DELAY
description (2190
). - Add StackOverflow as a support channel (
2257
).
- Packaging fix: disallow unsupported Twisted versions in setup.py
- Class attributes for subclasses of
ImagesPipeline
andFilesPipeline
work as they did before 1.1.1 (2243
, fixes2198
)
Overview <intro-overview>
andtutorial <intro-tutorial>
rewritten to use http://toscrape.com websites (2236
,2249
,2252
).
- Introduce a missing
IMAGES_STORE_S3_ACL
setting to override the default ACL policy inImagesPipeline
when uploading images to S3 (note that default ACL policy is "private" -- instead of "public-read" --since Scrapy 1.1.0) IMAGES_EXPIRES
default value set back to 90 (the regression was introduced in 1.1.1)
- Add "Host" header in CONNECT requests to HTTPS proxies (
2069
) - Use response
body
when choosing response class (2001
, fixes2000
) - Do not fail on canonicalizing URLs with wrong netlocs (
2038
, fixes2010
) - a few fixes for
HttpCompressionMiddleware
(andSitemapSpider
):- Do not decode HEAD responses (
2008
, fixes1899
) - Handle charset parameter in gzip Content-Type header (
2050
, fixes2049
) - Do not decompress gzip octet-stream responses (
2065
, fixes2063
)
- Do not decode HEAD responses (
- Catch (and ignore with a warning) exception when verifying certificate against IP-address hosts (
2094
, fixes2092
) - Make
FilesPipeline
andImagesPipeline
backward compatible again regarding the use of legacy class attributes for customization (1989
, fixes1985
)
- Enable genspider command outside project folder (
2052
) - Retry HTTPS CONNECT
TunnelError
by default (1974
)
FEED_TEMPDIR
setting at lexicographical position (9b3c72c
)- Use idiomatic
.extract_first()
in overview (1994
) - Update years in copyright notice (
c2c8036
) - Add information and example on errbacks (
1995
) - Use "url" variable in downloader middleware example (
2015
) - Grammar fixes (
2054
,2120
) - New FAQ entry on using BeautifulSoup in spider callbacks (
2048
) - Add notes about scrapy not working on Windows with Python 3 (
2060
) - Encourage complete titles in pull requests (
2026
)
- Upgrade py.test requirement on Travis CI and Pin pytest-cov to 2.2.1 (
2095
)
This 1.1 release brings a lot of interesting features and bug fixes:
- Scrapy 1.1 has beta Python 3 support (requires Twisted >= 15.5). See
news_betapy3
for more details and some limitations. - Hot new features:
- Item loaders now support nested loaders (
1467
). FormRequest.from_response
improvements (1382
,1137
).- Added setting
AUTOTHROTTLE_TARGET_CONCURRENCY
and improved AutoThrottle docs (1324
). - Added
response.text
to get body as unicode (1730
). - Anonymous S3 connections (
1358
). - Deferreds in downloader middlewares (
1473
). This enables better robots.txt handling (1471
). - HTTP caching now follows RFC2616 more closely, added settings
HTTPCACHE_ALWAYS_STORE
andHTTPCACHE_IGNORE_RESPONSE_CACHE_CONTROLS
(1151
). - Selectors were extracted to the parsel library (
1409
). This means you can use Scrapy Selectors without Scrapy and also upgrade the selectors engine without needing to upgrade Scrapy. - HTTPS downloader now does TLS protocol negotiation by default, instead of forcing TLS 1.0. You can also set the SSL/TLS method using the new
DOWNLOADER_CLIENT_TLS_METHOD
.
- Item loaders now support nested loaders (
- These bug fixes may require your attention:
- Don't retry bad requests (HTTP 400) by default (
1289
). If you need the old behavior, add400
toRETRY_HTTP_CODES
. - Fix shell files argument handling (
1710
,1550
). If you tryscrapy shell index.html
it will try to load the URL http://index.html, usescrapy shell ./index.html
to load a local file. - Robots.txt compliance is now enabled by default for newly-created projects (
1724
). Scrapy will also wait for robots.txt to be downloaded before proceeding with the crawl (1735
). If you want to disable this behavior, updateROBOTSTXT_OBEY
insettings.py
file after creating a new project. - Exporters now work on unicode, instead of bytes by default (
1080
). If you usePythonItemExporter
, you may want to update your code to disable binary mode which is now deprecated. - Accept XML node names containing dots as valid (
1533
). - When uploading files or images to S3 (with
FilesPipeline
orImagesPipeline
), the default ACL policy is now "private" instead of "public" Warning: backwards incompatible!. You can useFILES_STORE_S3_ACL
to change it. - We've reimplemented
canonicalize_url()
for more correct output, especially for URLs with non-ASCII characters (1947
). This could change link extractors output compared to previous scrapy versions. This may also invalidate some cache entries you could still have from pre-1.1 runs. Warning: backwards incompatible!.
- Don't retry bad requests (HTTP 400) by default (
Keep reading for more details on other improvements and bug fixes.
We have been hard at work to make Scrapy run on Python 3. As a result, now you can run spiders on Python 3.3, 3.4 and 3.5 (Twisted >= 15.5 required). Some features are still missing (and some may never be ported).
Almost all builtin extensions/middlewares are expected to work. However, we are aware of some limitations in Python 3:
- Scrapy does not work on Windows with Python 3
- Sending emails is not supported
- FTP download handler is not supported
- Telnet console is not supported
- Scrapy now has a Code of Conduct (
1681
). - Command line tool now has completion for zsh (
934
). - Improvements to
scrapy shell
:- Support for bpython and configure preferred Python shell via
SCRAPY_PYTHON_SHELL
(1100
,1444
). - Support URLs without scheme (
1498
) Warning: backwards incompatible! - Bring back support for relative file path (
1710
,1550
).
- Support for bpython and configure preferred Python shell via
- Added
MEMUSAGE_CHECK_INTERVAL_SECONDS
setting to change default check interval (1282
). - Download handlers are now lazy-loaded on first request using their scheme (
1390
,1421
). - HTTPS download handlers do not force TLS 1.0 anymore; instead, OpenSSL's
SSLv23_method()/TLS_method()
is used allowing to try negotiating with the remote hosts the highest TLS protocol version it can (1794
,1629
). RedirectMiddleware
now skips the status codes fromhandle_httpstatus_list
on spider attribute or inRequest
'smeta
key (1334
,1364
,1447
).- Form submission:
- now works with
<button>
elements too (1469
). - an empty string is now used for submit buttons without a value (
1472
)
- now works with
- Dict-like settings now have per-key priorities (
1135
,1149
and1586
). - Sending non-ASCII emails (
1662
) CloseSpider
andSpiderState
extensions now get disabled if no relevant setting is set (1723
,1725
).- Added method
ExecutionEngine.close
(1423
). - Added method
CrawlerRunner.create_crawler
(1528
). - Scheduler priority queue can now be customized via
SCHEDULER_PRIORITY_QUEUE
(1822
). .pps
links are now ignored by default in link extractors (1835
).- temporary data folder for FTP and S3 feed storages can be customized using a new
FEED_TEMPDIR
setting (1847
). FilesPipeline
andImagesPipeline
settings are now instance attributes instead of class attributes, enabling spider-specific behaviors (1891
).JsonItemExporter
now formats opening and closing square brackets on their own line (first and last lines of output file) (1950
).- If available,
botocore
is used forS3FeedStorage
,S3DownloadHandler
andS3FilesStore
(1761
,1883
). - Tons of documentation updates and related fixes (
1291
,1302
,1335
,1683
,1660
,1642
,1721
,1727
,1879
). - Other refactoring, optimizations and cleanup (
1476
,1481
,1477
,1315
,1290
,1750
,1881
).
- Added
to_bytes
andto_unicode
, deprecatedstr_to_unicode
andunicode_to_str
functions (778
). binary_is_text
is introduced, to replace use ofisbinarytext
(but with inverse return value) (1851
)- The
optional_features
set has been removed (1359
). - The
--lsprof
command line option has been removed (1689
). Warning: backward incompatible, but doesn't break user code. - The following datatypes were deprecated (
1720
):scrapy.utils.datatypes.MultiValueDictKeyError
scrapy.utils.datatypes.MultiValueDict
scrapy.utils.datatypes.SiteNode
- The previously bundled
scrapy.xlib.pydispatch
library was deprecated and replaced by pydispatcher.
telnetconsole
was relocated toextensions/
(1524
).- Note: telnet is not enabled on Python 3 (#1524 (comment))
- Scrapy does not retry requests that got a
HTTP 400 Bad Request
response anymore (1289
). Warning: backwards incompatible! - Support empty password for http_proxy config (
1274
). - Interpret
application/x-json
asTextResponse
(1333
). - Support link rel attribute with multiple values (
1201
). - Fixed
scrapy.http.FormRequest.from_response
when there is a<base>
tag (1564
). - Fixed
TEMPLATES_DIR
handling (1575
). - Various
FormRequest
fixes (1595
,1596
,1597
). - Makes
_monkeypatches
more robust (1634
). - Fixed bug on
XMLItemExporter
with non-string fields in items (1738
). - Fixed startproject command in OS X (
1635
). - Fixed PythonItemExporter and CSVExporter for non-string item types (
1737
). - Various logging related fixes (
1294
,1419
,1263
,1624
,1654
,1722
,1726
and1303
). - Fixed bug in
utils.template.render_templatefile()
(1212
). - sitemaps extraction from
robots.txt
is now case-insensitive (1902
). - HTTPS+CONNECT tunnels could get mixed up when using multiple proxies to same remote host (
1912
).
- Packaging fix: disallow unsupported Twisted versions in setup.py
- FIX: RetryMiddleware is now robust to non-standard HTTP status codes (
1857
) - FIX: Filestorage HTTP cache was checking wrong modified time (
1875
) - DOC: Support for Sphinx 1.4+ (
1893
) - DOC: Consistency in selectors examples (
1869
)
- FIX: [Backport] Ignore bogus links in LinkExtractors (fixes
907
,108195e
) - TST: Changed buildbot makefile to use 'pytest' (
1f3d90a
) - DOC: Fixed typos in tutorial and media-pipeline (
808a9ea
and803bd87
) - DOC: Add AjaxCrawlMiddleware to DOWNLOADER_MIDDLEWARES_BASE in settings docs (
aa94121
)
- Ignoring xlib/tx folder, depending on Twisted version. (
7dfa979
) - Run on new travis-ci infra (
6e42f0b
) - Spelling fixes (
823a1cc
) - escape nodename in xmliter regex (
da3c155
) - test xml nodename with dots (
4418fc3
) - TST don't use broken Pillow version in tests (
a55078c
) - disable log on version command. closes #1426 (
86fc330
) - disable log on startproject command (
db4c9fe
) - Add PyPI download stats badge (
df2b944
) - don't run tests twice on Travis if a PR is made from a scrapy/scrapy branch (
a83ab41
) - Add Python 3 porting status badge to the README (
73ac80d
) - fixed RFPDupeFilter persistence (
97d080e
) - TST a test to show that dupefilter persistence is not working (
97f2fb3
) - explicit close file on file:// scheme handler (
d9b4850
) - Disable dupefilter in shell (
c0d0734
) - DOC: Add captions to toctrees which appear in sidebar (
aa239ad
) - DOC Removed pywin32 from install instructions as it's already declared as dependency. (
10eb400
) - Added installation notes about using Conda for Windows and other OSes. (
1c3600a
) - Fixed minor grammar issues. (
7f4ddd5
) - fixed a typo in the documentation. (
b71f677
) - Version 1 now exists (
5456c0e
) - fix another invalid xpath error (
0a1366e
) - fix ValueError: Invalid XPath: //div/[id="not-exists"]/text() on selectors.rst (
ca8d60f
) - Typos corrections (
7067117
) - fix typos in downloader-middleware.rst and exceptions.rst, middlware -> middleware (
32f115c
) - Add note to ubuntu install section about debian compatibility (
23fda69
) - Replace alternative OSX install workaround with virtualenv (
98b63ee
) - Reference Homebrew's homepage for installation instructions (
1925db1
) - Add oldest supported tox version to contributing docs (
5d10d6d
) - Note in install docs about pip being already included in python>=2.7.9 (
85c980e
) - Add non-python dependencies to Ubuntu install section in the docs (
fbd010d
) - Add OS X installation section to docs (
d8f4cba
) - DOC(ENH): specify path to rtd theme explicitly (
de73b1a
) - minor: scrapy.Spider docs grammar (
1ddcc7b
) - Make common practices sample code match the comments (
1b85bcf
) - nextcall repetitive calls (heartbeats). (
55f7104
) - Backport fix compatibility with Twisted 15.4.0 (
b262411
) - pin pytest to 2.7.3 (
a6535c2
) - Merge pull request #1512 from mgedmin/patch-1 (
8876111
) - Merge pull request #1513 from mgedmin/patch-2 (
5d4daf8
) - Typo (
f8d0682
) - Fix list formatting (
5f83a93
) - fix scrapy squeue tests after recent changes to queuelib (
3365c01
) - Merge pull request #1475 from rweindl/patch-1 (
2d688cd
) - Update tutorial.rst (
fbc1f25
) - Merge pull request #1449 from rhoekman/patch-1 (
7d6538c
) - Small grammatical change (
8752294
) - Add openssl version to version command (
13c45ac
)
- add service_identity to scrapy install_requires (
cbc2501
) - Workaround for travis#296 (
66af9cd
)
- Twisted 15.3.0 does not raises PicklingError serializing lambda functions (
b04dd7d
) - Minor method name fix (
6f85c7f
) - minor: scrapy.Spider grammar and clarity (
9c9d2e0
) - Put a blurb about support channels in CONTRIBUTING (
c63882b
) - Fixed typos (
a9ae7b0
) - Fix doc reference. (
7c8a4fe
)
- Unquote request path before passing to FTPClient, it already escape paths (
cc00ad2
) - include tests/ to source distribution in MANIFEST.in (
eca227e
) - DOC Fix SelectJmes documentation (
b8567bc
) - DOC Bring Ubuntu and Archlinux outside of Windows subsection (
392233f
) - DOC remove version suffix from ubuntu package (
5303c66
) - DOC Update release date for 1.0 (
c89fa29
)
You will find a lot of new features and bugfixes in this major release. Make sure to check our updated overview <intro-overview>
to get a glance of some of the changes, along with our brushed tutorial <intro-tutorial>
.
Declaring and returning Scrapy Items is no longer necessary to collect the scraped data from your spider, you can now return explicit dictionaries instead.
Classic version
class MyItem(scrapy.Item):
url = scrapy.Field()
class MySpider(scrapy.Spider):
def parse(self, response):
return MyItem(url=response.url)
New version
class MySpider(scrapy.Spider):
def parse(self, response):
return {'url': response.url}
Last Google Summer of Code project accomplished an important redesign of the mechanism used for populating settings, introducing explicit priorities to override any given setting. As an extension of that goal, we included a new level of priority for settings that act exclusively for a single spider, allowing them to redefine project settings.
Start using it by defining a ~scrapy.spiders.Spider.custom_settings
class variable in your spider:
class MySpider(scrapy.Spider):
custom_settings = {
"DOWNLOAD_DELAY": 5.0,
"RETRY_ENABLED": False,
}
Read more about settings population: topics-settings
Scrapy 1.0 has moved away from Twisted logging to support Python built in’s as default logging system. We’re maintaining backward compatibility for most of the old custom interface to call logging functions, but you’ll get warnings to switch to the Python logging API entirely.
Old version
from scrapy import log
log.msg('MESSAGE', log.INFO)
New version
import logging
logging.info('MESSAGE')
Logging with spiders remains the same, but on top of the ~scrapy.spiders.Spider.log
method you’ll have access to a custom ~scrapy.spiders.Spider.logger
created for the spider to issue log events:
class MySpider(scrapy.Spider):
def parse(self, response):
self.logger.info('Response received')
Read more in the logging documentation: topics-logging
Another milestone for last Google Summer of Code was a refactoring of the internal API, seeking a simpler and easier usage. Check new core interface in: topics-api
A common situation where you will face these changes is while running Scrapy from scripts. Here’s a quick example of how to run a Spider manually with the new API:
from scrapy.crawler import CrawlerProcess
process = CrawlerProcess({
'USER_AGENT': 'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1)'
})
process.crawl(MySpider)
process.start()
Bear in mind this feature is still under development and its API may change until it reaches a stable status.
See more examples for scripts running Scrapy: topics-practices
There’s been a large rearrangement of modules trying to improve the general structure of Scrapy. Main changes were separating various subpackages into new projects and dissolving both scrapy.contrib and scrapy.contrib_exp into top level packages. Backward compatibility was kept among internal relocations, while importing deprecated modules expect warnings indicating their new place.
Outsourced packages
Note
These extensions went through some minor changes, e.g. some setting names were changed. Please check the documentation in each new repository to get familiar with the new usage.
Old location | New location |
---|---|
scrapy.commands.deploy | scrapyd-client <https://github.com /scrapy/scrapyd-client> (See other alternatives here: topics-deploy ) |
scrapy.contrib.djangoitem | scrapy-djangoitem <https://github. com/scrapy-plugins/scrapy-djangoite m> |
scrapy.webservice | scrapy-jsonrpc <https://github.com /scrapy-plugins/scrapy-jsonrpc> |
scrapy.contrib_exp and scrapy.contrib dissolutions
Old location | New location |
---|---|
scrapy.contrib_exp.downloadermiddleware.decompression | scrapy.downloadermiddlewares.decompression |
scrapy.contrib_exp.iterators | scrapy.utils.iterators |
scrapy.contrib.downloadermiddleware | scrapy.downloadermiddlewares |
scrapy.contrib.exporter | scrapy.exporters |
scrapy.contrib.linkextractors | scrapy.linkextractors |
scrapy.contrib.loader | scrapy.loader |
scrapy.contrib.loader.processor | scrapy.loader.processors |
scrapy.contrib.pipeline | scrapy.pipelines |
scrapy.contrib.spidermiddleware | scrapy.spidermiddlewares |
scrapy.contrib.spiders | scrapy.spiders |
|
scrapy.extensions.* |
Plural renames and Modules unification
Old location | New location |
---|---|
scrapy.command | scrapy.commands |
scrapy.dupefilter | scrapy.dupefilters |
scrapy.linkextractor | scrapy.linkextractors |
scrapy.spider | scrapy.spiders |
scrapy.squeue | scrapy.squeues |
scrapy.statscol | scrapy.statscollectors |
scrapy.utils.decorator | scrapy.utils.decorators |
Class renames
Old location | New location |
---|---|
scrapy.spidermanager.SpiderManager | scrapy.spiderloader.SpiderLoader |
Settings renames
Old location | New location |
---|---|
SPIDER_MANAGER_CLASS | SPIDER_LOADER_CLASS |
New Features and Enhancements
- Python logging (
1060
,1235
,1236
,1240
,1259
,1278
,1286
) - FEED_EXPORT_FIELDS option (
1159
,1224
) - Dns cache size and timeout options (
1132
) - support namespace prefix in xmliter_lxml (
963
) - Reactor threadpool max size setting (
1123
) - Allow spiders to return dicts. (
1081
) - Add Response.urljoin() helper (
1086
) - look in ~/.config/scrapy.cfg for user config (
1098
) - handle TLS SNI (
1101
) - Selectorlist extract first (
624
,1145
) - Added JmesSelect (
1016
) - add gzip compression to filesystem http cache backend (
1020
) - CSS support in link extractors (
983
) - httpcache dont_cache meta #19 #689 (
821
) - add signal to be sent when request is dropped by the scheduler (
961
) - avoid download large response (
946
) - Allow to specify the quotechar in CSVFeedSpider (
882
) - Add referer to "Spider error processing" log message (
795
) - process robots.txt once (
896
) - GSoC Per-spider settings (
854
) - Add project name validation (
817
) - GSoC API cleanup (
816
,1128
,1147
,1148
,1156
,1185
,1187
,1258
,1268
,1276
,1285
,1284
) - Be more responsive with IO operations (
1074
and1075
) - Do leveldb compaction for httpcache on closing (
1297
)
Deprecations and Removals
- Deprecate htmlparser link extractor (
1205
) - remove deprecated code from FeedExporter (
1155
) - a leftover for.15 compatibility (
925
) - drop support for CONCURRENT_REQUESTS_PER_SPIDER (
895
) - Drop old engine code (
911
) - Deprecate SgmlLinkExtractor (
777
)
Relocations
- Move exporters/__init__.py to exporters.py (
1242
) - Move base classes to their packages (
1218
,1233
) - Module relocation (
1181
,1210
) - rename SpiderManager to SpiderLoader (
1166
) - Remove djangoitem (
1177
) - remove scrapy deploy command (
1102
) - dissolve contrib_exp (
1134
) - Deleted bin folder from root, fixes #913 (
914
) - Remove jsonrpc based webservice (
859
) - Move Test cases under project root dir (
827
,841
) - Fix backward incompatibility for relocated paths in settings (
1267
)
Documentation
- CrawlerProcess documentation (
1190
) - Favoring web scraping over screen scraping in the descriptions (
1188
) - Some improvements for Scrapy tutorial (
1180
) - Documenting Files Pipeline together with Images Pipeline (
1150
) - deployment docs tweaks (
1164
) - Added deployment section covering scrapyd-deploy and shub (
1124
) - Adding more settings to project template (
1073
) - some improvements to overview page (
1106
) - Updated link in docs/topics/architecture.rst (
647
) - DOC reorder topics (
1022
) - updating list of Request.meta special keys (
1071
) - DOC document download_timeout (
898
) - DOC simplify extension docs (
893
) - Leaks docs (
894
) - DOC document from_crawler method for item pipelines (
904
) - Spider_error doesn't support deferreds (
1292
) - Corrections & Sphinx related fixes (
1220
,1219
,1196
,1172
,1171
,1169
,1160
,1154
,1127
,1112
,1105
,1041
,1082
,1033
,944
,866
,864
,796
,1260
,1271
,1293
,1298
)
Bugfixes
- Item multi inheritance fix (
353
,1228
) - ItemLoader.load_item: iterate over copy of fields (
722
) - Fix Unhandled error in Deferred (RobotsTxtMiddleware) (
1131
,1197
) - Force to read DOWNLOAD_TIMEOUT as int (
954
) - scrapy.utils.misc.load_object should print full traceback (
902
) - Fix bug for ".local" host name (
878
) - Fix for Enabled extensions, middlewares, pipelines info not printed anymore (
879
) - fix dont_merge_cookies bad behaviour when set to false on meta (
846
)
Python 3 In Progress Support
- disable scrapy.telnet if twisted.conch is not available (
1161
) - fix Python 3 syntax errors in ajaxcrawl.py (
1162
) - more python3 compatibility changes for urllib (
1121
) - assertItemsEqual was renamed to assertCountEqual in Python 3. (
1070
) - Import unittest.mock if available. (
1066
) - updated deprecated cgi.parse_qsl to use six's parse_qsl (
909
) - Prevent Python 3 port regressions (
830
) - PY3: use MutableMapping for python 3 (
810
) - PY3: use six.BytesIO and six.moves.cStringIO (
803
) - PY3: fix xmlrpclib and email imports (
801
) - PY3: use six for robotparser and urlparse (
800
) - PY3: use six.iterkeys, six.iteritems, and tempfile (
799
) - PY3: fix has_key and use six.moves.configparser (
798
) - PY3: use six.moves.cPickle (
797
) - PY3 make it possible to run some tests in Python3 (
776
)
Tests
- remove unnecessary lines from py3-ignores (
1243
) - Fix remaining warnings from pytest while collecting tests (
1206
) - Add docs build to travis (
1234
) - TST don't collect tests from deprecated modules. (
1165
) - install service_identity package in tests to prevent warnings (
1168
) - Fix deprecated settings API in tests (
1152
) - Add test for webclient with POST method and no body given (
1089
) - py3-ignores.txt supports comments (
1044
) - modernize some of the asserts (
835
) - selector.__repr__ test (
779
)
Code refactoring
- CSVFeedSpider cleanup: use iterate_spider_output (
1079
) - remove unnecessary check from scrapy.utils.spider.iter_spider_output (
1078
) - Pydispatch pep8 (
992
) - Removed unused 'load=False' parameter from walk_modules() (
871
) - For consistency, use job_dir helper in SpiderState extension. (
805
) - rename "sflo" local variables to less cryptic "log_observer" (
775
)
- encode invalid xpath with unicode_escape under PY2 (
07cb3e5
) - fix IPython shell scope issue and load IPython user config (
2c8e573
) - Fix small typo in the docs (
d694019
) - Fix small typo (
f92fa83
) - Converted sel.xpath() calls to response.xpath() in Extracting the data (
c2c6d15
)
- Support new _getEndpoint Agent signatures on Twisted 15.0.0 (
540b9bc
) - DOC a couple more references are fixed (
b4c454b
) - DOC fix a reference (
e3c1260
) - t.i.b.ThreadedResolver is now a new-style class (
9e13f42
) - S3DownloadHandler: fix auth for requests with quoted paths/query params (
cdb9a0b
) - fixed the variable types in mailsender documentation (
bb3a848
) - Reset items_scraped instead of item_count (
edb07a4
) - Tentative attention message about what document to read for contributions (
7ee6f7a
) - mitmproxy 0.10.1 needs netlib 0.10.1 too (
874fcdd
) - pin mitmproxy 0.10.1 as >0.11 does not work with tests (
c6b21f0
) - Test the parse command locally instead of against an external url (
c3a6628
) - Patches Twisted issue while closing the connection pool on HTTPDownloadHandler (
d0bf957
) - Updates documentation on dynamic item classes. (
eeb589a
) - Merge pull request #943 from Lazar-T/patch-3 (
5fdab02
) - typo (
b0ae199
) - pywin32 is required by Twisted. closes #937 (
5cb0cfb
) - Update install.rst (
781286b
) - Merge pull request #928 from Lazar-T/patch-1 (
b415d04
) - comma instead of fullstop (
627b9ba
) - Merge pull request #885 from jsma/patch-1 (
de909ad
) - Update request-response.rst (
3f3263d
) - SgmlLinkExtractor - fix for parsing <area> tag with Unicode present (
49b40f0
)
- pem file is used by mockserver and required by scrapy bench (
5eddc68
) - scrapy bench needs scrapy.tests* (
d6cb999
)
- no need to waste travis-ci time on py3 for 0.24 (
8e080c1
) - Update installation docs (
1d0c096
) - There is a trove classifier for Scrapy framework! (
4c701d7
) - update other places where w3lib version is mentioned (
d109c13
) - Update w3lib requirement to 1.8.0 (
39d2ce5
) - Use w3lib.html.replace_entities() (remove_entities() is deprecated) (
180d3ad
) - set zip_safe=False (
a51ee8b
) - do not ship tests package (
ee3b371
) - scrapy.bat is not needed anymore (
c3861cf
) - Modernize setup.py (
362e322
) - headers can not handle non-string values (
94a5c65
) - fix ftp test cases (
a274a7f
) - The sum up of travis-ci builds are taking like 50min to complete (
ae1e2cc
) - Update shell.rst typo (
e49c96a
) - removes weird indentation in the shell results (
1ca489d
) - improved explanations, clarified blog post as source, added link for XPath string functions in the spec (
65c8f05
) - renamed UserTimeoutError and ServerTimeouterror #583 (
037f6ab
) - adding some xpath tips to selectors docs (
2d103e0
) - fix tests to account for scrapy/w3lib#23 (
f8d366a
) - get_func_args maximum recursion fix #728 (
81344ea
) - Updated input/ouput processor example according to #560. (
f7c4ea8
) - Fixed Python syntax in tutorial. (
db59ed9
) - Add test case for tunneling proxy (
f090260
) - Bugfix for leaking Proxy-Authorization header to remote host when using tunneling (
d8793af
) - Extract links from XHTML documents with MIME-Type "application/xml" (
ed1f376
) - Merge pull request #793 from roysc/patch-1 (
91a1106
) - Fix typo in commands.rst (
743e1e2
) - better testcase for settings.overrides.setdefault (
e22daaf
) - Using CRLF as line marker according to http 1.1 definition (
5ec430b
)
- Use a mutable mapping to proxy deprecated settings.overrides and settings.defaults attribute (
e5e8133
) - there is not support for python3 yet (
3cd6146
) - Update python compatible version set to debian packages (
fa5d76b
) - DOC fix formatting in release notes (
c6a9e20
)
- Fix deprecated CrawlerSettings and increase backwards compatibility with .defaults attribute (
8e3f20a
)
- Improve Scrapy top-level namespace (
494
,684
) - Add selector shortcuts to responses (
554
,690
) - Add new lxml based LinkExtractor to replace unmantained SgmlLinkExtractor (
559
,761
,763
) - Cleanup settings API - part of per-spider settings GSoC project (
737
) - Add UTF8 encoding header to templates (
688
,762
) - Telnet console now binds to 127.0.0.1 by default (
699
) - Update debian/ubuntu install instructions (
509
,549
) - Disable smart strings in lxml XPath evaluations (
535
) - Restore filesystem based cache as default for http cache middleware (
541
,500
,571
) - Expose current crawler in Scrapy shell (
557
) - Improve testsuite comparing CSV and XML exporters (
570
) - New offsite/filtered and offsite/domains stats (
566
) - Support process_links as generator in CrawlSpider (
555
) - Verbose logging and new stats counters for DupeFilter (
553
) - Add a mimetype parameter to MailSender.send() (
602
) - Generalize file pipeline log messages (
622
) - Replace unencodeable codepoints with html entities in SGMLLinkExtractor (
565
) - Converted SEP documents to rst format (
629
,630
,638
,632
,636
,640
,635
,634
,639
,637
,631
,633
,641
,642
) - Tests and docs for clickdata's nr index in FormRequest (
646
,645
) - Allow to disable a downloader handler just like any other component (
650
) - Log when a request is discarded after too many redirections (
654
) - Log error responses if they are not handled by spider callbacks (
612
,656
) - Add content-type check to http compression mw (
193
,660
) - Run pypy tests using latest pypi from ppa (
674
) - Run test suite using pytest instead of trial (
679
) - Build docs and check for dead links in tox environment (
687
) - Make scrapy.version_info a tuple of integers (
681
,692
) - Infer exporter's output format from filename extensions (
546
,659
,760
) - Support case-insensitive domains in url_is_from_any_domain() (
693
) - Remove pep8 warnings in project and spider templates (
698
) - Tests and docs for request_fingerprint function (
597
) - Update SEP-19 for GSoC project per-spider settings (
705
) - Set exit code to non-zero when contracts fails (
727
) - Add a setting to control what class is instanciated as Downloader component (
738
) - Pass response in item_dropped signal (
724
) - Improve scrapy check contracts command (
733
,752
) - Document spider.closed() shortcut (
719
) - Document request_scheduled signal (
746
) - Add a note about reporting security issues (
697
) - Add LevelDB http cache storage backend (
626
,500
) - Sort spider list output of scrapy list command (
742
) - Multiple documentation enhancemens and fixes (
575
,587
,590
,596
,610
,617
,618
,627
,613
,643
,654
,675
,663
,711
,714
)
- Encode unicode URL value when creating Links in RegexLinkExtractor (
561
) - Ignore None values in ItemLoader processors (
556
) - Fix link text when there is an inner tag in SGMLLinkExtractor and HtmlParserLinkExtractor (
485
,574
) - Fix wrong checks on subclassing of deprecated classes (
581
,584
) - Handle errors caused by inspect.stack() failures (
582
) - Fix a reference to unexistent engine attribute (
593
,594
) - Fix dynamic itemclass example usage of type() (
603
) - Use lucasdemarchi/codespell to fix typos (
628
) - Fix default value of attrs argument in SgmlLinkExtractor to be tuple (
661
) - Fix XXE flaw in sitemap reader (
676
) - Fix engine to support filtered start requests (
707
) - Fix offsite middleware case on urls with no hostnames (
745
) - Testsuite doesn't require PIL anymore (
585
)
- fix a reference to unexistent engine.slots. closes #593 (
13c099a
) - downloaderMW doc typo (spiderMW doc copy remnant) (
8ae11bf
) - Correct typos (
1346037
)
- localhost666 can resolve under certain circumstances (
2ec2279
) - test inspect.stack failure (
cc3eda3
) - Handle cases when inspect.stack() fails (
8cb44f9
) - Fix wrong checks on subclassing of deprecated classes. closes #581 (
46d98d6
) - Docs: 4-space indent for final spider example (
13846de
) - Fix HtmlParserLinkExtractor and tests after #485 merge (
368a946
) - BaseSgmlLinkExtractor: Fixed the missing space when the link has an inner tag (
b566388
) - BaseSgmlLinkExtractor: Added unit test of a link with an inner tag (
c1cb418
) - BaseSgmlLinkExtractor: Fixed unknown_endtag() so that it only set current_link=None when the end tag match the opening tag (
7e4d627
) - Fix tests for Travis-CI build (
76c7e20
) - replace unencodeable codepoints with html entities. fixes #562 and #285 (
5f87b17
) - RegexLinkExtractor: encode URL unicode value when creating Links (
d0ee545
) - Updated the tutorial crawl output with latest output. (
8da65de
) - Updated shell docs with the crawler reference and fixed the actual shell output. (
875b9ab
) - PEP8 minor edits. (
f89efaf
) - Expose current crawler in the scrapy shell. (
5349cec
) - Unused re import and PEP8 minor edits. (
387f414
) - Ignore None's values when using the ItemLoader. (
0632546
) - DOC Fixed HTTPCACHE_STORAGE typo in the default value which is now Filesystem instead Dbm. (
cde9a8c
) - show ubuntu setup instructions as literal code (
fb5c9c5
) - Update Ubuntu installation instructions (
70fb105
) - Merge pull request #550 from stray-leone/patch-1 (
6f70b6a
) - modify the version of scrapy ubuntu package (
725900d
) - fix 0.22.0 release date (
af0219a
) - fix typos in news.rst and remove (not released yet) header (
b7f58f4
)
- [Backwards incompatible] Switched HTTPCacheMiddleware backend to filesystem (
541
) To restore old backend set HTTPCACHE_STORAGE to scrapy.contrib.httpcache.DbmCacheStorage - Proxy https:// urls using CONNECT method (
392
,397
) - Add a middleware to crawl ajax crawleable pages as defined by google (
343
) - Rename scrapy.spider.BaseSpider to scrapy.spider.Spider (
510
,519
) - Selectors register EXSLT namespaces by default (
472
) - Unify item loaders similar to selectors renaming (
461
) - Make RFPDupeFilter class easily subclassable (
533
) - Improve test coverage and forthcoming Python 3 support (
525
) - Promote startup info on settings and middleware to INFO level (
520
) - Support partials in get_func_args util (
506
, issue:504) - Allow running indiviual tests via tox (
503
) - Update extensions ignored by link extractors (
498
) - Add middleware methods to get files/images/thumbs paths (
490
) - Improve offsite middleware tests (
478
) - Add a way to skip default Referer header set by RefererMiddleware (
475
) - Do not send x-gzip in default Accept-Encoding header (
469
) - Support defining http error handling using settings (
466
) - Use modern python idioms wherever you find legacies (
497
) - Improve and correct documentation (
527
,524
,521
,517
,512
,505
,502
,489
,465
,460
,425
,536
)
- Update Selector class imports in CrawlSpider template (
484
) - Fix unexistent reference to engine.slots (
464
) - Do not try to call body_as_unicode() on a non-TextResponse instance (
462
) - Warn when subclassing XPathItemLoader, previously it only warned on instantiation. (
523
) - Warn when subclassing XPathSelector, previously it only warned on instantiation. (
537
) - Multiple fixes to memory stats (
531
,530
,529
) - Fix overriding url in FormRequest.from_response() (
507
) - Fix tests runner under pip 1.5 (
513
) - Fix logging error when spider name is unicode (
479
)
- Update CrawlSpider Template with Selector changes (
6d1457d
) - fix method name in tutorial. closes GH-480 (
b4fc359
- include_package_data is required to build wheels from published sources (
5ba1ad5
) - process_parallel was leaking the failures on its internal deferreds. closes #458 (
419a780
)
- New Selector's API including CSS selectors (
395
and426
), - Request/Response url/body attributes are now immutable (modifying them had been deprecated for a long time)
ITEM_PIPELINES
is now defined as a dict (instead of a list)- Sitemap spider can fetch alternate URLs (
360
) - Selector.remove_namespaces() now remove namespaces from element's attributes. (
416
) - Paved the road for Python 3.3+ (
435
,436
,431
,452
) - New item exporter using native python types with nesting support (
366
) - Tune HTTP1.1 pool size so it matches concurrency defined by settings (
b43b5f575
) - scrapy.mail.MailSender now can connect over TLS or upgrade using STARTTLS (
327
) - New FilesPipeline with functionality factored out from ImagesPipeline (
370
,409
) - Recommend Pillow instead of PIL for image handling (
317
) - Added debian packages for Ubuntu quantal and raring (
86230c0
) - Mock server (used for tests) can listen for HTTPS requests (
410
) - Remove multi spider support from multiple core components (
422
,421
,420
,419
,423
,418
) - Travis-CI now tests Scrapy changes against development versions of w3lib and queuelib python packages.
- Add pypy 2.1 to continuous integration tests (
ecfa7431
) - Pylinted, pep8 and removed old-style exceptions from source (
430
,432
) - Use importlib for parametric imports (
445
) - Handle a regression introduced in Python 2.7.5 that affects XmlItemExporter (
372
) - Bugfix crawling shutdown on SIGINT (
450
) - Do not submit reset type inputs in FormRequest.from_response (
b326b87
) - Do not silence download errors when request errback raises an exception (
684cfc0
)
- Fix tests under Django 1.6 (
b6bed44c
) - Lot of bugfixes to retry middleware under disconnections using HTTP 1.1 download handler
- Fix inconsistencies among Twisted releases (
406
) - Fix scrapy shell bugs (
418
,407
) - Fix invalid variable name in setup.py (
429
) - Fix tutorial references (
387
) - Improve request-response docs (
391
) - Improve best practices docs (
399
,400
,401
,402
) - Improve django integration docs (
404
) - Document bindaddress request meta (
37c24e01d7
) - Improve Request class documentation (
226
)
- Dropped Python 2.6 support (
448
) - Add cssselect python package as install dependency
- Drop libxml2 and multi selector's backend support, lxml is required from now on.
- Minimum Twisted version increased to 10.0.0, dropped Twisted 8.0 support.
- Running test suite now requires mock python library (
390
)
Thanks to everyone who contribute to this release!
List of contributors sorted by number of commits:
69 Daniel Graña <dangra@...>
37 Pablo Hoffman <pablo@...>
13 Mikhail Korobov <kmike84@...>
9 Alex Cepoi <alex.cepoi@...>
9 alexanderlukanin13 <alexander.lukanin.13@...>
8 Rolando Espinoza La fuente <darkrho@...>
8 Lukasz Biedrycki <lukasz.biedrycki@...>
6 Nicolas Ramirez <nramirez.uy@...>
3 Paul Tremberth <paul.tremberth@...>
2 Martin Olveyra <molveyra@...>
2 Stefan <misc@...>
2 Rolando Espinoza <darkrho@...>
2 Loren Davie <loren@...>
2 irgmedeiros <irgmedeiros@...>
1 Stefan Koch <taikano@...>
1 Stefan <cct@...>
1 scraperdragon <dragon@...>
1 Kumara Tharmalingam <ktharmal@...>
1 Francesco Piccinno <stack.box@...>
1 Marcos Campal <duendex@...>
1 Dragon Dave <dragon@...>
1 Capi Etheriel <barraponto@...>
1 cacovsky <amarquesferraz@...>
1 Berend Iwema <berend@...>
- IPython refuses to update the namespace. fix #396 (
3d32c4f
) - Fix AlreadyCalledError replacing a request in shell command. closes #407 (
b1d8919
) - Fix start_requests laziness and early hangs (
89faf52
)
- fix regression on lazy evaluation of start requests (
12693a5
) - forms: do not submit reset inputs (
e429f63
) - increase unittest timeouts to decrease travis false positive failures (
912202e
) - backport master fixes to json exporter (
cfc2d46
) - Fix permission and set umask before generating sdist tarball (
06149e0
)
- Backport scrapy check command fixes and backward compatible multi crawler process(
339
)
- remove extra import added by cherry picked changes (
d20304e
) - fix crawling tests under twisted pre 11.0.0 (
1994f38
) - py26 can not format zero length fields {} (
abf756f
) - test PotentiaDataLoss errors on unbound responses (
b15470d
) - Treat responses without content-length or Transfer-Encoding as good responses (
c4bf324
) - do no include ResponseFailed if http11 handler is not enabled (
6cbe684
) - New HTTP client wraps connection losts in ResponseFailed exception. fix #373 (
1a20bba
) - limit travis-ci build matrix (
3b01bb8
) - Merge pull request #375 from peterarenot/patch-1 (
fa766d7
) - Fixed so it refers to the correct folder (
3283809
) - added quantal & raring to support ubuntu releases (
1411923
) - fix retry middleware which didn't retry certain connection errors after the upgrade to http1 client, closes GH-373 (
bb35ed0
) - fix XmlItemExporter in Python 2.7.4 and 2.7.5 (
de3e451
) - minor updates to 0.18 release notes (
c45e5f1
) - fix contributters list format (
0b60031
)
- Lot of improvements to testsuite run using Tox, including a way to test on pypi
- Handle GET parameters for AJAX crawleable urls (
3fe2a32
) - Use lxml recover option to parse sitemaps (
347
) - Bugfix cookie merging by hostname and not by netloc (
352
) - Support disabling HttpCompressionMiddleware using a flag setting (
359
) - Support xml namespaces using iternodes parser in XMLFeedSpider (
12
) - Support dont_cache request meta flag (
19
) - Bugfix scrapy.utils.gz.gunzip broken by changes in python 2.7.4 (
4dc76e
) - Bugfix url encoding on SgmlLinkExtractor (
24
) - Bugfix TakeFirst processor shouldn't discard zero (0) value (
59
) - Support nested items in xml exporter (
66
) - Improve cookies handling performance (
77
) - Log dupe filtered requests once (
105
) - Split redirection middleware into status and meta based middlewares (
78
) - Use HTTP1.1 as default downloader handler (
109
and318
) - Support xpath form selection on FormRequest.from_response (
185
) - Bugfix unicode decoding error on SgmlLinkExtractor (
199
) - Bugfix signal dispatching on pypi interpreter (
205
) - Improve request delay and concurrency handling (
206
) - Add RFC2616 cache policy to HttpCacheMiddleware (
212
) - Allow customization of messages logged by engine (
214
) - Multiples improvements to DjangoItem (
217
,218
,221
) - Extend Scrapy commands using setuptools entry points (
260
) - Allow spider allowed_domains value to be set/tuple (
261
) - Support settings.getdict (
269
) - Simplify internal scrapy.core.scraper slot handling (
271
) - Added Item.copy (
290
) - Collect idle downloader slots (
297
) - Add ftp:// scheme downloader handler (
329
) - Added downloader benchmark webserver and spider tools
benchmarking
- Moved persistent (on disk) queues to a separate project (queuelib) which scrapy now depends on
- Add scrapy commands using external libraries (
260
) - Added
--pdb
option toscrapy
command line tool - Added
XPathSelector.remove_namespaces
which allows to remove all namespaces from XML documents for convenience (to work with namespace-less XPaths). Documented intopics-selectors
. - Several improvements to spider contracts
- New default middleware named MetaRefreshMiddldeware that handles meta-refresh html tag redirections,
- MetaRefreshMiddldeware and RedirectMiddleware have different priorities to address #62
- added from_crawler method to spiders
- added system tests with mock server
- more improvements to Mac OS compatibility (thanks Alex Cepoi)
- several more cleanups to singletons and multi-spider support (thanks Nicolas Ramirez)
- support custom download slots
- added --spider option to "shell" command.
- log overridden settings when scrapy starts
Thanks to everyone who contribute to this release. Here is a list of contributors sorted by number of commits:
130 Pablo Hoffman <pablo@...>
97 Daniel Graña <dangra@...>
20 Nicolás Ramírez <nramirez.uy@...>
13 Mikhail Korobov <kmike84@...>
12 Pedro Faustino <pedrobandim@...>
11 Steven Almeroth <sroth77@...>
5 Rolando Espinoza La fuente <darkrho@...>
4 Michal Danilak <mimino.coder@...>
4 Alex Cepoi <alex.cepoi@...>
4 Alexandr N Zamaraev (aka tonal) <tonal@...>
3 paul <paul.tremberth@...>
3 Martin Olveyra <molveyra@...>
3 Jordi Llonch <llonchj@...>
3 arijitchakraborty <myself.arijit@...>
2 Shane Evans <shane.evans@...>
2 joehillen <joehillen@...>
2 Hart <HartSimha@...>
2 Dan <ellisd23@...>
1 Zuhao Wan <wanzuhao@...>
1 whodatninja <blake@...>
1 vkrest <v.krestiannykov@...>
1 tpeng <pengtaoo@...>
1 Tom Mortimer-Jones <tom@...>
1 Rocio Aramberri <roschegel@...>
1 Pedro <pedro@...>
1 notsobad <wangxiaohugg@...>
1 Natan L <kuyanatan.nlao@...>
1 Mark Grey <mark.grey@...>
1 Luan <luanpab@...>
1 Libor Nenadál <libor.nenadal@...>
1 Juan M Uys <opyate@...>
1 Jonas Brunsgaard <jonas.brunsgaard@...>
1 Ilya Baryshev <baryshev@...>
1 Hasnain Lakhani <m.hasnain.lakhani@...>
1 Emanuel Schorsch <emschorsch@...>
1 Chris Tilden <chris.tilden@...>
1 Capi Etheriel <barraponto@...>
1 cacovsky <amarquesferraz@...>
1 Berend Iwema <berend@...>
- obey request method when scrapy deploy is redirected to a new endpoint (
8c4fcee
) - fix inaccurate downloader middleware documentation. refs #280 (
40667cb
) - doc: remove links to diveintopython.org, which is no longer available. closes #246 (
bd58bfa
) - Find form nodes in invalid html5 documents (
e3d6945
) - Fix typo labeling attrs type bool instead of list (
a274276
)
- fixes spelling errors in documentation (
6d2b3aa
) - add doc about disabling an extension. refs #132 (
c90de33
) - Fixed error message formatting. log.err() doesn't support cool formatting and when error occurred, the message was: "ERROR: Error processing %(item)s" (
c16150c
) - lint and improve images pipeline error logging (
56b45fc
) - fixed doc typos (
243be84
) - add documentation topics: Broad Crawls & Common Practies (
1fbb715
) - fix bug in scrapy parse command when spider is not specified explicitly. closes #209 (
c72e682
) - Update docs/topics/commands.rst (
28eac7a
)
- Remove concurrency limitation when using download delays and still ensure inter-request delays are enforced (
487b9b5
) - add error details when image pipeline fails (
8232569
) - improve mac os compatibility (
8dcf8aa
) - setup.py: use README.rst to populate long_description (
7b5310d
) - doc: removed obsolete references to ClientForm (
80f9bb6
) - correct docs for default storage backend (
2aa491b
) - doc: removed broken proxyhub link from FAQ (
bdf61c4
) - Fixed docs typo in SpiderOpenCloseLogging example (
7184094
)
- scrapy contracts: python2.6 compat (
a4a9199
) - scrapy contracts verbose option (
ec41673
) - proper unittest-like output for scrapy contracts (
86635e4
) - added open_in_browser to debugging doc (
c9b690d
) - removed reference to global scrapy stats from settings doc (
dd55067
) - Fix SpiderState bug in Windows platforms (
58998f4
)
- fixed LogStats extension, which got broken after a wrong merge before the 0.16 release (
8c780fd
) - better backwards compatibility for scrapy.conf.settings (
3403089
) - extended documentation on how to access crawler stats from extensions (
c4da0b5
) - removed .hgtags (no longer needed now that scrapy uses git) (
d52c188
) - fix dashes under rst headers (
fa4f7f9
) - set release date for 0.16.0 in news (
e292246
)
Scrapy changes:
- added
topics-contracts
, a mechanism for testing spiders in a formal/reproducible way - added options
-o
and-t
to therunspider
command - documented
topics/autothrottle
and added to extensions installed by default. You still need to enable it withAUTOTHROTTLE_ENABLED
- major Stats Collection refactoring: removed separation of global/per-spider stats, removed stats-related signals (
stats_spider_opened
, etc). Stats are much simpler now, backwards compatibility is kept on the Stats Collector API and signals. - added
~scrapy.contrib.spidermiddleware.SpiderMiddleware.process_start_requests
method to spider middlewares - dropped Signals singleton. Signals should now be accesed through the Crawler.signals attribute. See the signals documentation for more info.
- dropped Signals singleton. Signals should now be accesed through the Crawler.signals attribute. See the signals documentation for more info.
- dropped Stats Collector singleton. Stats can now be accessed through the Crawler.stats attribute. See the stats collection documentation for more info.
- documented
topics-api
- lxml is now the default selectors backend instead of libxml2
- ported FormRequest.from_response() to use lxml instead of ClientForm
- removed modules:
scrapy.xlib.BeautifulSoup
andscrapy.xlib.ClientForm
- SitemapSpider: added support for sitemap urls ending in .xml and .xml.gz, even if they advertise a wrong content type (
10ed28b
) - StackTraceDump extension: also dump trackref live references (
fe2ce93
) - nested items now fully supported in JSON and JSONLines exporters
- added
cookiejar
Request meta key to support multiple cookie sessions per spider - decoupled encoding detection code to w3lib.encoding, and ported Scrapy code to use that module
- dropped support for Python 2.5. See https://blog.scrapinghub.com/2012/02/27/scrapy-0-15-dropping-support-for-python-2-5/
- dropped support for Twisted 2.5
- added
REFERER_ENABLED
setting, to control referer middleware - changed default user agent to:
Scrapy/VERSION (+http://scrapy.org)
- removed (undocumented)
HTMLImageLinkExtractor
class fromscrapy.contrib.linkextractors.image
- removed per-spider settings (to be replaced by instantiating multiple crawler objects)
USER_AGENT
spider attribute will no longer work, useuser_agent
attribute insteadDOWNLOAD_TIMEOUT
spider attribute will no longer work, usedownload_timeout
attribute instead- removed
ENCODING_ALIASES
setting, as encoding auto-detection has been moved to the w3lib library - promoted
topics-djangoitem
to main contrib - LogFormatter method now return dicts(instead of strings) to support lazy formatting (
164
,dcef7b0
) - downloader handlers (
DOWNLOAD_HANDLERS
setting) now receive settings as the first argument of the constructor - replaced memory usage acounting with (more portable) resource module, removed
scrapy.utils.memory
module - removed signal:
scrapy.mail.mail_sent
- removed
TRACK_REFS
setting, nowtrackrefs <topics-leaks-trackrefs>
is always enabled - DBM is now the default storage backend for HTTP cache middleware
- number of log messages (per level) are now tracked through Scrapy stats (stat name:
log_count/LEVEL
) - number received responses are now tracked through Scrapy stats (stat name:
response_received_count
) - removed
scrapy.log.started
attribute
- added precise to supported ubuntu distros (
b7e46df
) - fixed bug in json-rpc webservice reported in https://groups.google.com/forum/#!topic/scrapy-users/qgVBmFybNAQ/discussion. also removed no longer supported 'run' command from extras/scrapy-ws.py (
340fbdb
) - meta tag attributes for content-type http equiv can be in any order. #123 (
0cb68af
) - replace "import Image" by more standard "from PIL import Image". closes #88 (
4d17048
) - return trial status as bin/runtests.sh exit value. #118 (
b7b2e7f
)
- forgot to include pydispatch license. #118 (
fd85f9c
) - include egg files used by testsuite in source distribution. #118 (
c897793
) - update docstring in project template to avoid confusion with genspider command, which may be considered as an advanced feature. refs #107 (
2548dcc
) - added note to docs/topics/firebug.rst about google directory being shut down (
668e352
) - dont discard slot when empty, just save in another dict in order to recycle if needed again. (
8e9f607
) - do not fail handling unicode xpaths in libxml2 backed selectors (
b830e95
) - fixed minor mistake in Request objects documentation (
bf3c9ee
) - fixed minor defect in link extractors documentation (
ba14f38
) - removed some obsolete remaining code related to sqlite support in scrapy (
0665175
)
- move buffer pointing to start of file before computing checksum. refs #92 (
6a5bef2
) - Compute image checksum before persisting images. closes #92 (
9817df1
) - remove leaking references in cached failures (
673a120
) - fixed bug in MemoryUsage extension: get_engine_status() takes exactly 1 argument (0 given) (
11133e9
) - fixed struct.error on http compression middleware. closes #87 (
1423140
) - ajax crawling wasn't expanding for unicode urls (
0de3fb4
) - Catch start_requests iterator errors. refs #83 (
454a21d
) - Speed-up libxml2 XPathSelector (
2fbd662
) - updated versioning doc according to recent changes (
0a070f5
) - scrapyd: fixed documentation link (
2b4e4c3
) - extras/makedeb.py: no longer obtaining version from git (
caffe0e
)
- extras/makedeb.py: no longer obtaining version from git (
caffe0e
) - bumped version to 0.14.1 (
6cb9e1c
) - fixed reference to tutorial directory (
4b86bd6
) - doc: removed duplicated callback argument from Request.replace() (
1aeccdd
) - fixed formatting of scrapyd doc (
8bf19e6
) - Dump stacks for all running threads and fix engine status dumped by StackTraceDump extension (
14a8e6e
) - added comment about why we disable ssl on boto images upload (
5223575
) - SSL handshaking hangs when doing too many parallel connections to S3 (
63d583d
) - change tutorial to follow changes on dmoz site (
bcb3198
) - Avoid _disconnectedDeferred AttributeError exception in Twisted>=11.1.0 (
98f3f87
) - allow spider to set autothrottle max concurrency (
175a4b5
)
- Support for AJAX crawleable urls
- New persistent scheduler that stores requests on disk, allowing to suspend and resume crawls (
2737
) - added
-o
option toscrapy crawl
, a shortcut for dumping scraped items into a file (or standard output using-
) - Added support for passing custom settings to Scrapyd
schedule.json
api (2779
,2783
) - New
ChunkedTransferMiddleware
(enabled by default) to support chunked transfer encoding (2769
) - Add boto 2.0 support for S3 downloader handler (
2763
) - Added marshal to formats supported by feed exports (
2744
) - In request errbacks, offending requests are now received in failure.request attribute (
2738
) - Big downloader refactoring to support per domain/ip concurrency limits (
2732
) CONCURRENT_REQUESTS_PER_SPIDER
setting has been deprecated and replaced by:CONCURRENT_REQUESTS
,CONCURRENT_REQUESTS_PER_DOMAIN
,CONCURRENT_REQUESTS_PER_IP
- check the documentation for more details
- Big downloader refactoring to support per domain/ip concurrency limits (
- Added builtin caching DNS resolver (
2728
) - Moved Amazon AWS-related components/extensions (SQS spider queue, SimpleDB stats collector) to a separate project: [scaws](https://github.com/scrapinghub/scaws) (
2706
,2714
) - Moved spider queues to scrapyd: scrapy.spiderqueue -> scrapyd.spiderqueue (
2708
) - Moved sqlite utils to scrapyd: scrapy.utils.sqlite -> scrapyd.sqlite (
2781
) - Real support for returning iterators on start_requests() method. The iterator is now consumed during the crawl when the spider is getting idle (
2704
) - Added
REDIRECT_ENABLED
setting to quickly enable/disable the redirect middleware (2697
) - Added
RETRY_ENABLED
setting to quickly enable/disable the retry middleware (2694
) - Added
CloseSpider
exception to manually close spiders (2691
) - Improved encoding detection by adding support for HTML5 meta charset declaration (
2690
) - Refactored close spider behavior to wait for all downloads to finish and be processed by spiders, before closing the spider (
2688
) - Added
SitemapSpider
(see documentation in Spiders page) (2658
) - Added
LogStats
extension for periodically logging basic stats (like crawled pages and scraped items) (2657
) - Make handling of gzipped responses more robust (#319,
2643
). Now Scrapy will try and decompress as much as possible from a gzipped response, instead of failing with an IOError. - Simplified !MemoryDebugger extension to use stats for dumping memory debugging info (
2639
) - Added new command to edit spiders:
scrapy edit
(2636
) and -e flag to genspider command that uses it (2653
) - Changed default representation of items to pretty-printed dicts. (
2631
). This improves default logging by making log more readable in the default case, for both Scraped and Dropped lines. - Added
spider_error
signal (2628
) - Added
COOKIES_ENABLED
setting (2625
) - Stats are now dumped to Scrapy log (default value of
STATS_DUMP
setting has been changed to True). This is to make Scrapy users more aware of Scrapy stats and the data that is collected there. - Added support for dynamically adjusting download delay and maximum concurrent requests (
2599
) - Added new DBM HTTP cache storage backend (
2576
) - Added
listjobs.json
API to Scrapyd (2571
) CsvItemExporter
: addedjoin_multivalued
parameter (2578
)- Added namespace support to
xmliter_lxml
(2552
) - Improved cookies middleware by making COOKIES_DEBUG nicer and documenting it (
2579
) - Several improvements to Scrapyd and Link extractors
- Merged item passed and item scraped concepts, as they have often proved confusing in the past. This means: (
2630
) - original item_scraped signal was removed
- original item_passed signal was renamed to item_scraped
- old log lines
Scraped Item...
were removed - old log lines
Passed Item...
were renamed toScraped Item...
lines and downgraded toDEBUG
level
- Merged item passed and item scraped concepts, as they have often proved confusing in the past. This means: (
- Removed unused function: scrapy.utils.request.request_info() (
2577
) - Removed googledir project from examples/googledir. There's now a new example project called dirbot available on github: https://github.com/scrapy/dirbot
- Removed support for default field values in Scrapy items (
2616
) - Removed experimental crawlspider v2 (
2632
) - Removed scheduler middleware to simplify architecture. Duplicates filter is now done in the scheduler itself, using the same dupe fltering class as before (DUPEFILTER_CLASS setting) (
2640
) - Removed support for passing urls to
scrapy crawl
command (usescrapy parse
instead) (2704
) - Removed deprecated Execution Queue (
2704
) - Removed (undocumented) spider context extension (from scrapy.contrib.spidercontext) (
2780
) - removed
CONCURRENT_SPIDERS
setting (use scrapyd maxproc instead) (2789
) - Renamed attributes of core components: downloader.sites -> downloader.slots, scraper.sites -> scraper.slots (
2717
,2718
) - Renamed setting
CLOSESPIDER_ITEMPASSED
toCLOSESPIDER_ITEMCOUNT
(2655
). Backwards compatibility kept.
The numbers like #NNN reference tickets in the old issue tracker (Trac) which is no longer available.
- Passed item is now sent in the
item
argument of theitem_passed
(#273) - Added verbose option to
scrapy version
command, useful for bug reports (#298) - HTTP cache now stored by default in the project data dir (#279)
- Added project data storage directory (#276, #277)
- Documented file structure of Scrapy projects (see command-line tool doc)
- New lxml backend for XPath selectors (#147)
- Per-spider settings (#245)
- Support exit codes to signal errors in Scrapy commands (#248)
- Added
-c
argument toscrapy shell
command - Made
libxml2
optional (#260) - New
deploy
command (#261) - Added
CLOSESPIDER_PAGECOUNT
setting (#253) - Added
CLOSESPIDER_ERRORCOUNT
setting (#254)
- Scrapyd now uses one process per spider
- It stores one log file per spider run, and rotate them keeping the lastest 5 logs per spider (by default)
- A minimal web ui was added, available at http://localhost:6800 by default
- There is now a scrapy server command to start a Scrapyd server of the current project
- added HTTPCACHE_ENABLED setting (False by default) to enable HTTP cache middleware
- changed HTTPCACHE_EXPIRATION_SECS semantics: now zero means "never expire".
- Deprecated
runserver
command in favor ofserver
command which starts a Scrapyd server. See also: Scrapyd changes - Deprecated
queue
command in favor of using Scrapydschedule.json
API. See also: Scrapyd changes - Removed the !LxmlItemLoader (experimental contrib which never graduated to main contrib)
The numbers like #NNN reference tickets in the old issue tracker (Trac) which is no longer available.
- New Scrapy service called
scrapyd
for deploying Scrapy crawlers in production (#218) (documentation available) - Simplified Images pipeline usage which doesn't require subclassing your own images pipeline now (#217)
- Scrapy shell now shows the Scrapy log by default (#206)
- Refactored execution queue in a common base code and pluggable backends called "spider queues" (#220)
- New persistent spider queue (based on SQLite) (#198), available by default, which allows to start Scrapy in server mode and then schedule spiders to run.
- Added documentation for Scrapy command-line tool and all its available sub-commands. (documentation available)
- Feed exporters with pluggable backends (#197) (documentation available)
- Deferred signals (#193)
- Added two new methods to item pipeline open_spider(), close_spider() with deferred support (#195)
- Support for overriding default request headers per spider (#181)
- Replaced default Spider Manager with one with similar functionality but not depending on Twisted Plugins (#186)
- Splitted Debian package into two packages - the library and the service (#187)
- Scrapy log refactoring (#188)
- New extension for keeping persistent spider contexts among different runs (#203)
- Added dont_redirect request.meta key for avoiding redirects (#233)
- Added dont_retry request.meta key for avoiding retries (#234)
- New scrapy command which replaces the old scrapy-ctl.py (#199)
- there is only one global scrapy command now, instead of one scrapy-ctl.py per project
- Added scrapy.bat script for running more conveniently from Windows
- Added bash completion to command-line tool (#210)
- Renamed command start to runserver (#209)
url
andbody
attributes of Request objects are now read-only (#230)Request.copy()
andRequest.replace()
now also copies theircallback
anderrback
attributes (#231)- Removed
UrlFilterMiddleware
fromscrapy.contrib
(already disabled by default) - Offsite middelware doesn't filter out any request coming from a spider that doesn't have a allowed_domains attribute (#225)
- Removed Spider Manager
load()
method. Now spiders are loaded in the constructor itself. - Changes to Scrapy Manager (now called "Crawler"):
scrapy.core.manager.ScrapyManager
class renamed toscrapy.crawler.Crawler
scrapy.core.manager.scrapymanager
singleton moved toscrapy.project.crawler
- Moved module:
scrapy.contrib.spidermanager
toscrapy.spidermanager
- Spider Manager singleton moved from
scrapy.spider.spiders
to thespiders` attribute of
scrapy.project.crawler`` singleton. - moved Stats Collector classes: (#204)
scrapy.stats.collector.StatsCollector
toscrapy.statscol.StatsCollector
scrapy.stats.collector.SimpledbStatsCollector
toscrapy.contrib.statscol.SimpledbStatsCollector
- default per-command settings are now specified in the
default_settings
attribute of command object class (#201) - changed arguments of Item pipeline
process_item()
method from(spider, item)
to(item, spider)
- backwards compatibility kept (with deprecation warning)
- changed arguments of Item pipeline
- moved
scrapy.core.signals
module toscrapy.signals
- backwards compatibility kept (with deprecation warning)
- moved
- moved
scrapy.core.exceptions
module toscrapy.exceptions
- backwards compatibility kept (with deprecation warning)
- moved
- added
handles_request()
class method toBaseSpider
- dropped
scrapy.log.exc()
function (usescrapy.log.err()
instead) - dropped
component
argument ofscrapy.log.msg()
function - dropped
scrapy.log.log_level
attribute - Added
from_settings()
class methods to Spider Manager, and Item Pipeline Manager
- Added
HTTPCACHE_IGNORE_SCHEMES
setting to ignore certain schemes on !HttpCacheMiddleware (#225) - Added
SPIDER_QUEUE_CLASS
setting which defines the spider queue to use (#220) - Added
KEEP_ALIVE
setting (#220) - Removed
SERVICE_QUEUE
setting (#220) - Removed
COMMANDS_SETTINGS_MODULE
setting (#201) - Renamed
REQUEST_HANDLERS
toDOWNLOAD_HANDLERS
and make download handlers classes (instead of functions)
The numbers like #NNN reference tickets in the old issue tracker (Trac) which is no longer available.
- Added SMTP-AUTH support to scrapy.mail
- New settings added:
MAIL_USER
,MAIL_PASS
(2065
| #149) - Added new scrapy-ctl view command - To view URL in the browser, as seen by Scrapy (
2039
) - Added web service for controlling Scrapy process (this also deprecates the web console. (
2053
| #167) - Support for running Scrapy as a service, for production systems (
1988
,2054
,2055
,2056
,2057
| #168) - Added wrapper induction library (documentation only available in source code for now). (
2011
) - Simplified and improved response encoding support (
1961
,1969
) - Added
LOG_ENCODING
setting (1956
, documentation available) - Added
RANDOMIZE_DOWNLOAD_DELAY
setting (enabled by default) (1923
, doc available) MailSender
is no longer IO-blocking (1955
| #146)- Linkextractors and new Crawlspider now handle relative base tag urls (
1960
| #148) - Several improvements to Item Loaders and processors (
2022
,2023
,2024
,2025
,2026
,2027
,2028
,2029
,2030
) - Added support for adding variables to telnet console (
2047
| #165) - Support for requests without callbacks (
2050
| #166)
- Change
Spider.domain_name
toSpider.name
(SEP-012,1975
) Response.encoding
is now the detected encoding (1961
)HttpErrorMiddleware
now returns None or raises an exception (2006
| #157)scrapy.command
modules relocation (2035
,2036
,2037
)- Added
ExecutionQueue
for feeding spiders to scrape (2034
) - Removed
ExecutionEngine
singleton (2039
) - Ported
S3ImagesStore
(images pipeline) to use boto and threads (2033
) - Moved module:
scrapy.management.telnet
toscrapy.telnet
(2047
)
- Changed default
SCHEDULER_ORDER
toDFO
(1939
)
The numbers like #NNN reference tickets in the old issue tracker (Trac) which is no longer available.
- Added DEFAULT_RESPONSE_ENCODING setting (
1809
) - Added
dont_click
argument toFormRequest.from_response()
method (1813
,1816
) - Added
clickdata
argument toFormRequest.from_response()
method (1802
,1803
) - Added support for HTTP proxies (
HttpProxyMiddleware
) (1781
,1785
) - Offsite spider middleware now logs messages when filtering out requests (
1841
)
- Changed
scrapy.utils.response.get_meta_refresh()
signature (1804
) - Removed deprecated
scrapy.item.ScrapedItem
class - usescrapy.item.Item instead
(1838
) - Removed deprecated
scrapy.xpath
module - usescrapy.selector
instead. (1836
) - Removed deprecated
core.signals.domain_open
signal - usecore.signals.domain_opened
instead (1822
) log.msg()
now receives aspider
argument (1822
)- Old domain argument has been deprecated and will be removed in 0.9. For spiders, you should always use the
spider
argument and pass spider references. If you really want to pass a string, use thecomponent
argument instead.
- Old domain argument has been deprecated and will be removed in 0.9. For spiders, you should always use the
- Changed core signals
domain_opened
,domain_closed
,domain_idle
- Changed Item pipeline to use spiders instead of domains
- The
domain
argument ofprocess_item()
item pipeline method was changed tospider
, the new signature is:process_item(spider, item)
(1827
| #105) - To quickly port your code (to work with Scrapy 0.8) just use
spider.domain_name
where you previously useddomain
.
- The
- Changed Stats API to use spiders instead of domains (
1849
| #113) StatsCollector
was changed to receive spider references (instead of domains) in its methods (set_value
,inc_value
, etc).- added
StatsCollector.iter_spider_stats()
method - removed
StatsCollector.list_domains()
method - Also, Stats signals were renamed and now pass around spider references (instead of domains). Here's a summary of the changes:
- To quickly port your code (to work with Scrapy 0.8) just use
spider.domain_name
where you previously useddomain
.spider_stats
contains exactly the same data asdomain_stats
.
- Changed Stats API to use spiders instead of domains (
CloseDomain
extension moved toscrapy.contrib.closespider.CloseSpider
(1833
)- Its settings were also renamed:
CLOSEDOMAIN_TIMEOUT
toCLOSESPIDER_TIMEOUT
CLOSEDOMAIN_ITEMCOUNT
toCLOSESPIDER_ITEMCOUNT
- Removed deprecated
SCRAPYSETTINGS_MODULE
environment variable - useSCRAPY_SETTINGS_MODULE
instead (1840
) - Renamed setting:
REQUESTS_PER_DOMAIN
toCONCURRENT_REQUESTS_PER_SPIDER
(1830
,1844
) - Renamed setting:
CONCURRENT_DOMAINS
toCONCURRENT_SPIDERS
(1830
) - Refactored HTTP Cache middleware
- HTTP Cache middleware has been heavilty refactored, retaining the same functionality except for the domain sectorization which was removed. (
1843
) - Renamed exception:
DontCloseDomain
toDontCloseSpider
(1859
| #120) - Renamed extension:
DelayedCloseDomain
toSpiderCloseDelay
(1861
| #121) - Removed obsolete
scrapy.utils.markup.remove_escape_chars
function - usescrapy.utils.markup.replace_escape_chars
instead (1865
)
First release of Scrapy.