free-proxy
free-proxy copied to clipboard
failed to get proxy
I haven't received a proxy yet, is it possible that it no longer works? I will install with pip Here is my code
def proxy():
i = 1
while True:
try:
proxy = FreeProxy(google=True, https=True).get()
except:
status_fail = Fore.RED + 'FAIL'
print(f'failed to get proxy {status_fail}')
time.sleep(2)
if i == 50:
status_fail = Fore.RED + 'proxy not found'
sys.exit(f'{status_fail}')
i += 1
else:
status_ok = Fore.GREEN + 'OK'
print(f'proxy {proxy} status {status_ok}')
break
return proxy
proxy = proxy()
50 lines always "failed to get proxy FAIL" Any ideas? Thank you
I removed https=True from the code and everything worked immediately