import re

import requests

from bs4 import BeautifulSoup as bs
from jfr_playoff.logger import PlayoffLogger

class RemoteUrl:

    url_cache = {}

    @classmethod
    def fetch(cls, url):
        PlayoffLogger.get('remote').info(
            'fetching content for: %s', url)
        if url not in cls.url_cache:
            request = requests.get(url)
            encoding_match = re.search(
                'content=".*;( )?charset=(.*)"',
                request.content, re.IGNORECASE)
            if encoding_match:
                request.encoding = encoding_match.group(2)
            cls.url_cache[url] = request.text
        return bs(cls.url_cache[url], 'lxml')

@@ -620,16 +620,160 @@
 st.text%0A
+            PlayoffLogger.get('remote').info(%0A                'fetched %25d bytes from remote location',%0A                len(cls.url_cache%5Burl%5D))%0A
         

Debug information on remote URL fetch