improved content-type detection
This commit is contained in:
@@ -62,7 +62,7 @@ class WebPage(object):
|
|||||||
request = urllib.request.Request(self.url, headers=self.headers)
|
request = urllib.request.Request(self.url, headers=self.headers)
|
||||||
page = urllib.request.urlopen(request, timeout=5)
|
page = urllib.request.urlopen(request, timeout=5)
|
||||||
headers = page.info()
|
headers = page.info()
|
||||||
if headers['content-type'] == "text/html":
|
if "text/html" in headers['content-type']:
|
||||||
self.source = page.read()
|
self.source = page.read()
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user