def _extract_urls_domains(self, file_data, urls, domains):
    if ((not self._config[PROC_EMAIL_JSON_EXTRACT_DOMAINS]) and (not self._config[PROC_EMAIL_JSON_EXTRACT_URLS])):
        return
    try:
        soup = BeautifulSoup(file_data, 'html.parser')
    except Exception as e:
        self._base_connector.debug_print(e)
        return
    uris = []
    links = soup.find_all(href=True)
    if links:
        uris = [x['href'] for x in links if (not x['href'].startswith('mailto:'))]
        uri_text = [self._clean_url(x.get_text()) for x in links]
        if uri_text:
            uri_text = [x for x in uri_text if x.startswith('http')]
            if uri_text:
                uris.extend(uri_text)
    else:
        uris = re.findall(uri_regexc, file_data)
        if uris:
            uris = [self._clean_url(x) for x in uris]
    if self._config[PROC_EMAIL_JSON_EXTRACT_URLS]:
        urls |= set(uris)
    if self._config[PROC_EMAIL_JSON_EXTRACT_DOMAINS]:
        for uri in uris:
            domain = phantom.get_host_from_url(uri)
            if (domain and (not self._is_ip(domain))):
                domains.add(domain)
        if links:
            mailtos = [x['href'] for x in links if x['href'].startswith('mailto:')]
            for curr_email in mailtos:
                domain = curr_email[(curr_email.find('@') + 1):]
                if (domain and (not self._is_ip(domain))):
                    domains.add(domain)
    return
def _extract_urls_domains(self, file_data, urls, domains):
    if ((not self._config[PROC_EMAIL_JSON_EXTRACT_DOMAINS]) and (not self._config[PROC_EMAIL_JSON_EXTRACT_URLS])):
        return
    try:
        soup = BeautifulSoup(file_data, 'html.parser')
    except Exception as e:
        self._base_connector.debug_print(e)
        return
    uris = []
    links = soup.find_all(href=True)
    if links:
        uris = [x['href'] for x in links if (not x['href'].startswith('mailto:'))]
        uri_text = [self._clean_url(x.get_text()) for x in links]
        if uri_text:
            uri_text = [x for x in uri_text if x.startswith('http')]
            if uri_text:
                uris.extend(uri_text)
    else:
        uris = re.findall(uri_regexc, file_data)
        if uris:
            uris = [self._clean_url(x) for x in uris]
    if self._config[PROC_EMAIL_JSON_EXTRACT_URLS]:
        urls |= set(uris)
    if self._config[PROC_EMAIL_JSON_EXTRACT_DOMAINS]:
        for uri in uris:
            domain = phantom.get_host_from_url(uri)
            if (domain and (not self._is_ip(domain))):
                domains.add(domain)
        if links:
            mailtos = [x['href'] for x in links if x['href'].startswith('mailto:')]
            for curr_email in mailtos:
                domain = curr_email[(curr_email.find('@') + 1):]
                if (domain and (not self._is_ip(domain))):
                    domains.add(domain)
    return