Ejemplo n.º 1
0
def main():
    print('Testing abuyun cla')
    used_time_list = []
    valid_count = 0
    total_count = 0
    while True:
        total_count += 1
        test_flag, test_result = test_proxy(proxies=proxies)
        if test_flag:
            valid_count += 1
            used_time_list.append(test_result)
        stats_result(used_time_list, valid_count, total_count)
        time.sleep(wait)
        if total_count == max:
            break
Ejemplo n.º 2
0
def main():
    print('Testing kuaidaili')
    used_time_list = []
    valid_count = 0
    total_count = 0
    while True:
        flag, result = get_page(api_url)
        if flag:
            proxy = result.strip()
            if is_proxy(proxy):
                total_count += 1
                print('Testing proxy', proxy)
                test_flag, test_result = test_proxy(proxy=proxy)
                if test_flag:
                    valid_count += 1
                    used_time_list.append(test_result)
                stats_result(used_time_list, valid_count, total_count)
        time.sleep(wait)
        if total_count == max:
            break