def extract_html_tags(text: str, keys: list[str]) -> dict[str, list[str]]:
    """Extract the content within HTML tags for a list of keys.

    Parameters
    ----------
    text : str
        The input string containing the HTML tags.
    keys : list of str
        The HTML tags to extract the content from.

    Returns:
    -------
    dict
        A dictionary mapping each key to a list of subset in `text` that match the key.

    Notes:
    -----
    All text and keys will be converted to lowercase before matching.

    """
    content_dict = {}
    # text = text.lower()
    # keys = set([k.lower() for k in keys])
    for key in keys:
        pattern = f'<{key}>(.*?)</{key}>'
        matches = re.findall(pattern, text, re.DOTALL)
        if matches:
            content_dict[key] = [match.strip() for match in matches]
    return content_dict
Extract the content within HTML tags for a list of keys.

    Parameters
    ----------
    text : str
        The input string containing the HTML tags.
    keys : list of str
        The HTML tags to extract the content from.

    Returns:
    -------
    dict
        A dictionary mapping each key to a list of subset in `text` that match the key.

    Notes:
    -----
    All text and keys will be converted to lowercase before matching.

    
openhands/agenthub/browsing_agent/utils.py