def clean_html(text: str) -> str:
    """
    Cleans HTML content by fetching its text representation using BeautifulSoup.
    """
    if text is None:
        return ""

    if isinstance(text, dict):
        return str(text)
    if isinstance(text, str):
        try:
            if is_url(text):
                response = requests.get(text)
                if response.status_code == 200:
                    html_content = response.text
                    soup = BeautifulSoup(html_content, "lxml")
                    cleaned_text = soup.get_text()
                else:
                    cleaned_text = ""
            elif os.path.isfile(text):
                with open(text) as file:
                    soup = BeautifulSoup(file, "lxml")
                    cleaned_text = soup.get_text()
            else:
                with warnings.catch_warnings():
                    warnings.filterwarnings("ignore", category=UserWarning)
                    soup = BeautifulSoup(text, "lxml")
                    cleaned_text = soup.get_text()
            return cleaned_text
        except (
            requests.exceptions.RequestException,
            requests.exceptions.ConnectionError,
        ):
            # If there is a connection error or the URL doesn't resolve, skip it
            return ""

    return str(text)

    Cleans HTML content by fetching its text representation using BeautifulSoup.
    
llama-index-integrations/readers/llama-index-readers-wordlift/llama_index/readers/wordlift/base.py