From 54e92867bcd0306816fde71f5f87bfbf235cd4b8 Mon Sep 17 00:00:00 2001 From: Lorenzo Di Fuccia Date: Fri, 3 Aug 2018 09:57:53 +0200 Subject: [PATCH] Bug fixes --- safaribooks.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/safaribooks.py b/safaribooks.py index 3e6ce31..7edec1f 100644 --- a/safaribooks.py +++ b/safaribooks.py @@ -88,7 +88,7 @@ class Display: self.out(output) self.save_last_request() - sys.exit(128) + sys.exit(1) def unhandled_exception(self, _, o, tb): self.log("".join(traceback.format_tb(tb))) @@ -523,7 +523,7 @@ class SafariBooks: def get_html(self, url): response = self.requests_provider(url) - if response == 0: + if response == 0 or response.status_code != 200: self.display.exit( "Crawler: error trying to retrieve this page: %s (%s)\n From: %s" % (self.filename, self.chapter_title, url)