def fetch_url_content()

in olddocs/gen_edot_col_components/tools.py [0:0]


def fetch_url_content(url):
    try:
        with urllib.request.urlopen(url) as response:
            # Read and decode the response
            content = response.read().decode('utf-8')
        return content
    except urllib.error.URLError as e:
        print(f"Failed to retrieve content: {e.reason}")
        return None