From 8e61c0dc7aba894abe68a40ddc6d712e103c1e2c Mon Sep 17 00:00:00 2001 From: graterje Date: Thu, 23 Feb 2017 18:25:24 -0500 Subject: [PATCH] Update cogeco.py Proposed change to replace escaped-in-hex characters with their ASCII equivalent. --- cogeco.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cogeco.py b/cogeco.py index 1c1f88a..ffb5e07 100644 --- a/cogeco.py +++ b/cogeco.py @@ -1,5 +1,6 @@ import urllib, urllib2, re from cookies import Cookies +from HTMLParser import HTMLParser class Cogeco: """ @@ -37,7 +38,8 @@ def authorize(streamProvider, username, password): return None Cookies.saveCookieJar(jar) - html = resp.read() + h = HTMLParser() + html = h.unescape(resp.read()) # TODO: this could be made a function to to parse and return the value based on an expression action = re.search('