Hey guys i have this code that i have been working on and all it does is checks if a proxy is valid or not. Though it produces no error, it dosent seem to be working because when i add bad proxies on purpose it still prints out as if it is working. im not sure why this is the case and would appreciate some help.
def check_proxies(): print('[#] Checking proxies now ') def check_proxies(proxy): try: r = requests.get('https://www.test.com/', proxies={'http':proxy}, timeout=3) if r.status_code == 200: fproxy.append(proxy) print(Fore.GREEN + 'Working proxy --> ', proxy) else: print(Fore.RED + 'Not working proxy --> ', proxy) pass except TimeoutError: pass except ConnectionError: pass def proxies(proxy): with concurrent.futures.ThreadPoolExecutor(max_workers=30) as executor: executor.map(check_proxies, proxy) proxies(proxy)
buran write Jan-19-2021, 08:54 AM:
Please, use proper tags when post code, traceback, output, etc. This time I have added tags for you.
See BBcode help for more info.
Please, use proper tags when post code, traceback, output, etc. This time I have added tags for you.
See BBcode help for more info.