question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Firstly, 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:closed
  • Created 7 years ago
  • Comments:6

github_iconTop GitHub Comments

1reaction
madisonbcommented, Dec 3, 2016

@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!

0reactions
rksaxenacommented, Oct 2, 2017

@nguyenanhnhat : Patch the code from this commit in the crawler/crawling/distributed_scheduler.py and it should work

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found