I open the file as follows:
with open(proxy_file) as proxy: ips = [row.rstrip() for row in proxy] If I remember correctly, all data is stored as follows:
['1.2.3.4:80', '1.2.3.4:3128', '1.2.3.4:8080'] And so on. Can I somehow do an alternate search of these addresses? And then I have so far only succeeded in making a random selection from the list.
index = random.randint(0,len(ips)-1) proxies = {'http': ips[index]}