mirror of https://github.com/scrapy/scrapy.git
cookiejar: docs updated ("skip: start/end")
This commit is contained in:
parent
20913cc787
commit
0628e93fe6
|
|
@ -277,7 +277,7 @@ Direct access to cookiejars from spider
|
|||
In some cases it is required to directly set specific values in an existing
|
||||
cookiejar.
|
||||
|
||||
.. skip: next
|
||||
.. skip: start
|
||||
.. code-block:: python
|
||||
|
||||
import scrapy
|
||||
|
|
@ -309,6 +309,8 @@ cookiejar.
|
|||
p.crawl(Quotes)
|
||||
p.start()
|
||||
|
||||
.. skip: end
|
||||
|
||||
.. note::
|
||||
|
||||
If :reqmeta:`cookiejar` didn't specified in request meta, middleware will read this as ``None``, as result of this middleware will create cookiejar object under dict key ``None``.
|
||||
|
|
@ -340,7 +342,7 @@ If cookie middleware is enabled, ``get_cookiejar(response_or_request)`` method a
|
|||
|
||||
It allows a bit easier access to cookiejar object:
|
||||
|
||||
.. skip: next
|
||||
.. skip: start
|
||||
.. code-block:: python
|
||||
|
||||
...
|
||||
|
|
@ -349,6 +351,7 @@ If cookie middleware is enabled, ``get_cookiejar(response_or_request)`` method a
|
|||
locale_cookie = (
|
||||
self.get_cookiejar(response).jar._cookies["quotes.toscrape.com"]["/"].get("session")
|
||||
)
|
||||
.. skip: end
|
||||
|
||||
Known use cases where direct access to cookiejar objects can be useful:
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue