-
Notifications
You must be signed in to change notification settings - Fork 453
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Custom Splash responses #45
Merged
Changes from all commits
Commits
Show all changes
36 commits
Select commit
Hold shift + click to select a range
19d1170
initial implementation of custom Splash responses
kmike ca52e1d
small cleanup
kmike 82ccc1c
SplashRequest: get _original_url from request meta; improve __repr__
kmike 637595b
expose SplashRequest as scrapyjs.SplashRequest
kmike eeb5972
fixed creation of custom Splash response classes
kmike f25075e
fixed response caching and duplication detection
kmike 67b8c5e
ignore .scrapy folder
kmike ddd515d
response class is fixed by middleware for cached responses
kmike 1ec775f
DOC typo fix
kmike 32126fd
DOC mention that SplashRequest handles URL fragments automatically
kmike 913aff2
add an option to return unprocessed responses
kmike 74df321
TST enable branch coverage
kmike e581c66
special handling of some JSON keys in Splash responses
kmike 86427bd
TST test that caching works for SplashResponses
kmike c3cd10d
TST add htmlcov to .gitignore
kmike a5d7070
only fix Response class if it is not fixed yet
kmike f0519ab
fix Content-Type header for magic responses built from 'html' key
kmike 9b7ed67
extract headers_to_scrapy function
kmike fee2662
set SplashResponse cookies from 'cookies' json
kmike c2d7153
PY2 fixed cookie handing
kmike 643ee3c
SplashJsonResponse: extract magic response handing to a method
kmike 0af058b
DOC fixed SplashResponse for Splash servers which use HTTP compression
kmike 373264a
make sure SplashRequest is never handled by AjaxCrawlMiddleware
kmike b43ea3a
DOC readme and example improvements
kmike 3fc7d09
DOC typo fix
kmike 356f19f
DOC fixed a typo in example
kmike 12e81b7
Fixed repr of SplashRequest when if haven't reached SplashMiddleware yet
kmike 69eb8f6
Log content of Splash Bad Request errors. See GH-37.
kmike 6b777b5
cookies handling overhaul
kmike 5a54996
response.cookiejar
kmike 10162df
DOC improve cookie docs
kmike 67c1ae8
actually set response.cookiejar
kmike 6637779
cleanup cookie handling: drop unneeded code, add more tests
kmike 5a8954c
TST add a test form SplashRequest repr
kmike d394c6f
add support for SplashRequest 'cookies' argument
kmike 92018c4
pass headers to Splash by default
kmike File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[run] | ||
branch = true |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,3 +5,5 @@ dist | |
scrapyjs.egg-info | ||
.cache | ||
.coverage | ||
.scrapy | ||
htmlcov |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,8 @@ | ||
# -*- coding: utf-8 -*- | ||
from __future__ import absolute_import | ||
|
||
from .middleware import SplashMiddleware, SlotPolicy | ||
from .middleware import SplashMiddleware, SlotPolicy, SplashCookiesMiddleware | ||
from .dupefilter import SplashAwareDupeFilter, splash_request_fingerprint | ||
from .cache import SplashAwareFSCacheStorage | ||
from .response import SplashResponse, SplashTextResponse, SplashJsonResponse | ||
from .request import SplashRequest |
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think both
session_id
andnew_session_id
are currently (https://github.com/scrapy-plugins/scrapy-splash/pull/45/files#diff-93e5c0fca1f417cfa28d48c75408be45R59) searched for inrequest.meta['splash']
, not in ```request.meta['splash']['args']`. Which is more correct, the docs or the code?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A good catch; the code is correct.
args
are arguments sent to Splash;new_session_id
is a SplashMiddleware option.