How do I use proxies from a text file with requests? The proxies in the file are in the format: ip:port So I can't really build a dict like {'scheme' : 'scheme://ip:port'}
And I need to access two different sites with the same proxy and then switch the proxy. One of the site uses HTTP and the other uses HTTPS.
I tried doing this for the HTTP request:
response = c.get(url, proxies = {'http': 'http://'+p})
And this for the HTTPS request:
response = c.get(url, proxies = {'https': 'https://'+p})
But the first one doesn't work and throws me an error.
Any workarounds for this?