callback Issues
See original GitHub issueFirstly, thanks for a wonderful project. It is really helpful in scaling web crawling without much efforts.
The issue I am facing is that I am trying to add a callback function other than the parse
method in Request
object but on doing so, callback function is not getting called while parse() gets called everytime.
Snippet.
req = Request(url, callback=self.parse_contents)
for key in response.meta.keys():
req.meta[key] = response.meta[key]
yield req
If I move the parse_contents
code within parse function, everything works fine but to do so I have to a couple of checks that I wish to avoid. So, is the callback function supposed to be only parse
function or am I missing something.
Issue Analytics
- State:
- Created 7 years ago
- Comments:6
Top Results From Across the Web
The Practical Problems with Callbacks in JavaScript
You have probably heard about this argument, but we should peruse the problems with handling errors in nested callbacks together.
Read more >Learn Callback Problems: Inversion of Control
The "Callback Problems: Inversion of Control" Lesson is part of the full, Rethinking Asynchronous JavaScript course featured in this preview video.
Read more >JavaScript Callbacks Variable Scope Problem - Pluralsight
In this free JavaScript guide, you'll learn how to fix the common JavaScript callbacks variable scope problem. This step-by-step JavaScript ...
Read more >How to deal with nested callbacks and avoid “callback hell”
JavaScript is a strange language. Once in a while, you have to deal with a callback that's in another callback that's in yet...
Read more >The Good and Bad of JavaScript Callbacks - Bits and Pieces
Callbacks are functions that are called back later. If you think I didn't explain ... Here is how to use promises to resolve...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@rksaxena Please check the
dev
branch and associated docker containers for the update I just made. I created an simple spider that generated different requests with different callback methods and everything seems to work correctly.If this solves your problem please close this!
@nguyenanhnhat : Patch the code from this commit in the
crawler/crawling/distributed_scheduler.py
and it should work