from bs4 import BeautifulSoup


def get_extension_num_users(extension_soup: BeautifulSoup) -> str:
    """Returns the number of users of extension if found, else 'Not Found'"""
    # wrappers = list(extension_soup.findAll('div'))
    try:
        wrappers = list(extension_soup.findAll('dl', class_="MetadataCard-list"))
        for i in range(len(wrappers)):
            # print(wrappers[i].find('dt', class_="MetadataCard-title").get_text())
            if(wrappers[i].find('dt', class_="MetadataCard-title").get_text() == "Users"):
                # the title is users, so we have the previous one
                return wrappers[i].find('dd', class_="MetadataCard-content").get_text().replace(',', '')
    except Exception as e:
        print(e)
        
    return "Not Found"