diff options
Diffstat (limited to 'jfr_playoff/remote.py')
-rw-r--r-- | jfr_playoff/remote.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/jfr_playoff/remote.py b/jfr_playoff/remote.py new file mode 100644 index 0000000..b6d0a34 --- /dev/null +++ b/jfr_playoff/remote.py @@ -0,0 +1,13 @@ +import urllib + +from bs4 import BeautifulSoup as bs + +class RemoteUrl: + + url_cache = {} + + @classmethod + def fetch(cls, url): + if url not in cls.url_cache: + cls.url_cache[url] = urllib.urlopen(url).read() + return bs(cls.url_cache[url], 'lxml') |