def checkHTML(self, html, url): """Parses html content or any arbitrary text for links and returns result of `checkURLs` :param html: html source :return: """ urls = [] if html: urls += [x[0] for x in urlmatcher.findall(html)] if url: page = getURL(url) urls += [x[0] for x in urlmatcher.findall(page)] return self.checkLinks(uniqify(urls))
def parseURLs(self, html=None, url=None): """Parses html content or any arbitrary text for links and returns result of `checkURLs` :param html: html source :return: """ urls = [] if html: urls += [x[0] for x in urlmatcher.findall(html)] if url: page = getURL(url) urls += [x[0] for x in urlmatcher.findall(page)] # remove duplicates return self.checkURLs(set(urls))