I currently want to create an application which downloads something with changing proxies. At the moment, I have to enter the proxies into a list by myself and if they aren't working, the application just crashes. Can I somehow either get a list of working proxies at the start of the application or can I check a proxy for its functionality before it sends out an error? Thanks for your help in advance, Till
I've tried different api's to get rotating proxies, but when one of them doesn't work, I still have the problem of it crashing.
proxy = session.get('https://gimmeproxy.com/api/getProxy?supportsHttps=TRUE&ipPort=true&country=DE').text
proxies = {
"http": "http://" + proxy,
"https": "http://" + proxy,
}
r = session.get('https://api.ipify.org/?format=json', proxies=proxies)
print(r)
I expect the output to be the IP of the proxy I'm using, but sometimes I get different errors (for instance 'Connection refused' or 'Cannot connect to proxy.') and the application crashes afterwards