Skip to content

Instantly share code, notes, and snippets.

View c3pmark's full-sized avatar

Mark Johnston c3pmark

  • Canadian Centre for Child Protection
View GitHub Profile
from scrapy.core.downloader.handlers.http import HTTPDownloadHandler
from scrapy.core.downloader.handlers.http11 import ScrapyAgent, reactor
# This overrides the default Scrapy agent, which discards partial responses when we
# hit the timeout, and forces it to instead return what we got back.
class TimeoutProcessingAgent(ScrapyAgent):
def download_request(self, request):