Well you'll need to load in the proxylist which can be done like so,
Code:
try:
proxy_list = open('proxies.txt', 'r', encoding='utf8', errors='ignore').readlines()
except IOError:
# Your error handling here
Next you need to get a random proxy from that file or make a function that does that for you. Each work the same.
Code:
import random
def proxy_machine():
proxy_list = open('proxies.txt', 'r', encoding='utf8', errors='ignore').readlines()
return random.choice(proxy_list).strip()
Or
Quote:import random
proxy_list = open('proxies.txt', 'r', encoding='utf8', errors='ignore').readlines()
def check_login_whatever():
global proxy_list
randomProxy = random.choice(proxy_list).strip()
socks4 = {'https': f'socks4://{randomProxy}'}
socks5 = {'https': f'socks5://{randomProxy}'}
https = {'https': f'https://{randomProxy}'}
Now once you have actually gotten the proxies, formatted them, now you need to actually pass them into the requests object. If you're using a requests session, you can do `session.proxies = socks4` or whatever and if you're using a requests object you can do `requests.get(url, proxies=socks4)`
Hope this'll help you learn some more about Python.
Always confirm via PM before dealing with me.