From 20a7ae6ec3575052727cc7e6d7b84a7cf8f2c85b Mon Sep 17 00:00:00 2001 From: emkael Date: Mon, 30 Dec 2019 00:06:28 +0100 Subject: Fetching raw, non-BS4parsed remote content --- jfr_playoff/remote.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/jfr_playoff/remote.py b/jfr_playoff/remote.py index f0bf6c2..6fb7e36 100644 --- a/jfr_playoff/remote.py +++ b/jfr_playoff/remote.py @@ -10,7 +10,7 @@ class RemoteUrl: url_cache = {} @classmethod - def fetch(cls, url): + def fetch_raw(cls, url): PlayoffLogger.get('remote').info( 'fetching content for: %s', url) if url not in cls.url_cache: @@ -24,4 +24,8 @@ class RemoteUrl: PlayoffLogger.get('remote').info( 'fetched %d bytes from remote location', len(cls.url_cache[url])) - return bs(cls.url_cache[url], 'lxml') + return cls.url_cache[url] + + @classmethod + def fetch(cls, url): + return bs(RemoteUrl.fetch_raw(url), 'lxml') -- cgit v1.2.3