Release notes

Scrapy 2.4.1 (2020-11-17)

Scrapy 2.4.0 (2020-10-11)

Highlights:

  • Python 3.5 support has been dropped.

  • The file_path method of media pipelines can now access the source item.

    This allows you to set a download file path based on item data.

  • The new item_export_kwargs key of the FEEDS setting allows to define keyword parameters to pass to item exporter classes

  • You can now choose whether feed exports overwrite or append to the output file.

    For example, when using the crawl or runspider commands, you can use the -O option instead of -o to overwrite the output file.

  • Zstd-compressed responses are now supported if zstandard is installed.

  • In settings, where the import path of a class is required, it is now possible to pass a class object instead.

Modified requirements

Backward-incompatible changes

  • CookiesMiddleware once again discards cookies defined in Request.headers.

    We decided to revert this bug fix, introduced in Scrapy 2.2.0, because it was reported that the current implementation could break existing code.

    If you need to set cookies for a request, use the Request.cookies parameter.

    A future version of Scrapy will include a new, better implementation of the reverted bug fix.

    (issue 4717, issue 4823)

Deprecation removals

  • scrapy.extensions.feedexport.S3FeedStorage no longer reads the values of access_key and secret_key from the running project settings when they are not passed to its __init__ method; you must either pass those parameters to its __init__ method or use S3FeedStorage.from_crawler (issue 4356, issue 4411, issue 4688)
  • Rule.process_request no longer admits callables which expect a single request parameter, rather than both request and response (issue 4818)

Deprecations

New features

Bug fixes