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.
PR Overview
This PR adds the selector message. It depends on the #5, so old commits can be ignored in this PR (I'll cherry-pick the new ones later).
Example
I implemented an example to show the advantages of using
selector_response
. You can read it here: https://gist.github.com/aron-bordin/97ca4233b5a304cd1466c5322b358cc6It's the same spider developed here: http://gsoc2016.readthedocs.io/en/latest/quickstart.html#source-code but it doesn't requires any HTML processor.
You pass the css/xpath filter in the request: https://gist.github.com/aron-bordin/97ca4233b5a304cd1466c5322b358cc6#file-dmoz-py-L21 and just use the resulting data: https://gist.github.com/aron-bordin/97ca4233b5a304cd1466c5322b358cc6#file-dmoz-py-L34
Docs:
You can read about the request here: http://gsoc2016.readthedocs.io/en/latest/protocol.html#selector-request
And response here: http://gsoc2016.readthedocs.io/en/latest/protocol.html#response-selector
WIP
This PR needs to be tested and implemented in the helper packages. So please, let me know if this is a good feature. If so, I'll implement the tests and implement it in the helper packages.
cc: @eLRuLL , @rolando