Closed codelucas closed 8 years ago
I'm hitting a similar problem, although not quite on the same scale. Simply, I don't see how to catch the Timeout exception, and associate it with a specific URL.
Hmm, since posting this issue I got around this problem by catching errors when a request fails and logging or printing out the failed url to try later.
Check out my modified version of grequests. I don't think it is worth sending a pull request for though.
I was reading online, there is a good chance that the entire "Timeout" exception or whatever is a bit misleading. We are probably just getting rate limited by the target website!
A way to catch those exceptions wouldn't just be nice, it seems pretty necessary. That alone is likely to keep me from using this library since I'm scraping lots of sites that may or may not respond and I don't want the output spammed by exceptions.
When I attempt to call map with 500 or more requests, usually a few of my requests timeout (I set it to 7 seconds).
This is ok but the error messages display and i'm not sure how to catch these errors because all the work is done individually in the map() method from grequests.
Can I either catch these timeouts individually somehow, or somehow log all the failed requests and re-attempt them? What is usually the protocol when sending out a bunch of requests asynchronously with the requirement that they all return back.