From 6d9103c154e0d9a559aa42bd1ebefbaeca8ca6f8 Mon Sep 17 00:00:00 2001 From: Simon Weald Date: Thu, 6 Sep 2018 17:08:12 +0100 Subject: [PATCH] improved content-type detection --- utils/helpers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/helpers.py b/utils/helpers.py index 2c65a0f..94fe187 100644 --- a/utils/helpers.py +++ b/utils/helpers.py @@ -62,7 +62,7 @@ class WebPage(object): request = urllib.request.Request(self.url, headers=self.headers) page = urllib.request.urlopen(request, timeout=5) headers = page.info() - if headers['content-type'] == "text/html": + if "text/html" in headers['content-type']: self.source = page.read()