diff options
author | emkael <emkael@tlen.pl> | 2019-12-30 00:06:28 +0100 |
---|---|---|
committer | emkael <emkael@tlen.pl> | 2019-12-30 00:06:28 +0100 |
commit | 20a7ae6ec3575052727cc7e6d7b84a7cf8f2c85b (patch) | |
tree | cf023c31192902cd5d140482e55315a26b76ffc0 | |
parent | c904ec2a826f1a55adff51d8db90f224008ca350 (diff) |
Fetching raw, non-BS4parsed remote content
-rw-r--r-- | jfr_playoff/remote.py | 8 |
1 files 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') |