def clean_text (product): 
    """ Clean product or supplier text: delete extra spaces and clean links"""

    # Clean text
    text_clean = product.replace("\n", "").replace("  ", "").strip()

    # Replace characters
    text_clean = text_clean.replace("&amp;", "&")

    # Delete links
    link_end = text_clean.find("</a>")
    if link_end != -1:

        # Delete start link
        link_start_open = text_clean.find("<a")
        link_start_close = text_clean.find(">")
        link_start = text_clean[link_start_open-1:link_start_close+1]
        text_clean = text_clean.replace(link_start, " ")

        # Delete end link
        text_clean = text_clean.replace("</a>", "")

        # Clean again
        text_clean = text_clean.strip()

    return text_clean