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
Updating flags in Response.follow and TextResponse.follow #4279
Conversation
Codecov Report
@@ Coverage Diff @@
## master #4279 +/- ##
==========================================
- Coverage 84.14% 83.72% -0.42%
==========================================
Files 166 165 -1
Lines 9761 9893 +132
Branches 1462 1469 +7
==========================================
+ Hits 8213 8283 +70
- Misses 1295 1354 +59
- Partials 253 256 +3
|
Hello, and many thanks for the contribution. I have two comments:
I think the first comment should be addressed before approval. I would be ok with leaving the second one to a separate PR, since it's not a matter of just adding one line or test function to an existing test case. |
Thanks for the update. One additional comment I forgot to make the first time: flags also need to be passed when creating the Request and when invoking the method from the parent class. |
Yes I was about to ask the same, on it. |
I'll add the test case in a separate PR. |
Thanks. Indeed, |
@Prime-5 we usually do tests together with changes/features; if you intend to send a PR with tests anyways, would you mind adding commits to this PR instead? |
Hello @kmike, I've added a test case but I'm not sure why there's a conflict. |
The updated |
Yes, that is almost certainly what's happening, it should be solved by adding the flags to the |
I've ran into a little trouble. I'm sorry for asking this here because it's not related to scrapy but to the workflow of github. |
My personal setup involves having two git remotes, Looking at the commit history from your fork, I'd recommend you reset your history, something like:
Then you can merge the changes from
At this point, you will have some conflicts, which you can solve by following this guide. Hope this helps, let us know if you still have problems. Cheers! |
@elacuesta thanks a lot for the patient reply :) |
The error is in the test function. For calling the |
|
Should I add tests for testing the |
Could you update the TextResponse.follow_all
method as well? Since the follow_all
feature has not been released yet I think it's ok to add the parameter before the css
and xpath
ones.
Hello, sorry for the delay, I was caught up in my university exams. I have now added the parameter in |
Thanks for the update. While we're at it, could you add a test to make sure |
I've added tests to check |
@elacuesta should there be a feature to allow returning different flag values over succeeding urls when called from |
I don't think that is necessary, all other parameters (cookies, headers, etc) are passed to all generated requests. |
In reference to #4277, added "flags" parameter to
Response.follow
andTextResponse.follow
(edit) Fixes #4277