Repository navigation
feat(crawlers)!: Replace HTTP client persist_cookies_per_session with crawler save_response_cookies - #2366
Open
Mantisus wants to merge 1 commit into
Open
feat(crawlers)!: Replace HTTP client persist_cookies_per_session with crawler save_response_cookies#2366Mantisus wants to merge 1 commit into
persist_cookies_per_session with crawler save_response_cookies#2366Mantisus wants to merge 1 commit into
Conversation
Mantisus
force-pushed
the
save-response-cookies
branch
from
November 3, 2026 15:45
eb9ff91 to
ae6d58b
Compare
Mantisus
marked this pull request as ready for review
November 3, 2026 15:48
vdusek
reviewed
Nov 5, 2026
Comment on lines
+674
to
+676
|
|
||
| # Kept out of `_PlaywrightCrawlerAdditionalOptions`, since `AdaptivePlaywrightCrawler` passes those to its browser | ||
| # sub-crawler only, while its static sub-crawler would keep saving the response cookies. |
Collaborator
There was a problem hiding this comment.
Note: AdaptivePlaywrightCrawler has no way to set save_response_cookies. Its **kwargs is _BasicCrawlerOptions, and this field is kept out of playwright_crawler_specific_kwargs, so adaptive users lose the v1 persist_cookies_per_session=False switch with nothing to replace it. Could AdaptivePlaywrightCrawler.__init__, with_beautifulsoup_static_parser and with_parsel_static_parser take save_response_cookies and pass it to both sub-crawlers? The upgrade guide could then mention it.
✍️ Drafted by Claude Code
Comment on lines
50
to
53
| """Helper fixture to reduce code duplication. | ||
| If clients are not initialized, create their default instances. | ||
| Return client in active context, leave the context after the test.""" | ||
|
|
Collaborator
There was a problem hiding this comment.
Nit: with the "not initialized" line removed, the docstring has a leftover second paragraph. One line is enough:
Suggested change
| """Helper fixture to reduce code duplication. | |
| If clients are not initialized, create their default instances. | |
| Return client in active context, leave the context after the test.""" | |
| """Enter the client passed by indirect parametrization and leave its context after the test.""" |
✍️ Drafted by Claude Code
persist_cookies_per_session with a save_response_cookies crawler optionpersist_cookies_per_session with crawler save_response_cookies
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
persist_cookies_per_sessionis removed from the HTTP clients. The HTTP crawlers,PlaywrightCrawlerandStagehandCrawlertake a newsave_response_cookiesoption instead, as in Crawlee JS. Withsave_response_cookies=False, the session cookies are still sent, but the cookies set by the responses aren't saved to the session. InPlaywrightCrawlerandStagehandCrawler, the option stops saving the cookies of the page to the session after the request handler.context.send_requestalways saves the response cookies withBasicCrawlerand the HTTP crawlers, whatever the option. In v1,persist_cookies_per_session=Falseapplied to it too. The v2 upgrade guide describes the migration.Issues
HttpClientbase class #2307cookiesargument tosend_request#2352✍️ Drafted by Claude Code