def independent_proxy_engine(url): ''' 独立代理引擎,用于重新获取单个异常网页的代理 :param url: 异常网页的 url 链接 :return: ''' LOG.info("[+] 开始重新获取代理") Console_Color.print_color(str="[*] 开始重新获取代理", forecolor="洋红") global VALID_URL_PROXY auth = authentication.Authentication(headers=HEADERS) proxyOP = proxyPool.IPOperator(headers=HEADERS) while True: proxyDict = proxy_engine(proxyOP) if auth.proxyVerify(url, proxyDict["protocol"], proxyDict["ip"], proxyDict["port"]): global VALID_URL_PROXY VALID_URL_PROXY[url] = proxyDict break
def __html_a(self, url, time_parse, name, dict_data): ''' 主要内容 :param url: 子链接地址 :param name: 标题 :param time_parse: 时间 :param *args: 其他内容 :return: 返回主要内容 ''' Console_Color.print_color("[+] 写入主要内容: {0}".format(name)) html_a = """ <Hr width="100%"> ├─<a>[{1}] #### </a><a href="{0}" target="_blank">{2}</a><br> """.format(url, time_parse, name) html_a_second = """""" for key, value in dict_data.items(): html_a_second_tmp = """ ├───────<a>{0}</a><br> """.format("{0}: {1}".format(key, value)) html_a_second += html_a_second_tmp html = html_a + html_a_second + "<Hr width='100%'>" return html
def __init__(self): Console_Color.print_color("[*] 正在初始化HTML数据写入模块")