May-01-2020, 06:15 AM
I'm trying to use requests with proxies, but it only shows my local IP
Here's my test code.
Here's my test code.
#!/usr/bin/python3 import requests import random impo proxies = [ "167.172.248.53:3128", "194.226.34.132:5555", "203.202.245.62:80", "141.0.70.211:8080", "118.69.50.155:80", "201.55.164.177:3128", "51.15.166.107:3128", "91.205.218.64:80", "128.199.237.57:8080", ] def get_session(proxies): session = requests.Session() proxy = random.choice(proxies) session.proxies = {"http://": proxy, "https://": proxy} return session, proxy for i in range(5): s, proxy = get_session(proxies) try: print( f"Proxying through {proxy}:", s.get("http://icanhazip.com", timeout=1.5).text.strip(), ) except Exception as e: continueI
Proxying through 141.0.70.211:8080: 51.25x.xxx.193 Proxying through 201.55.164.177:3128: 51.25x.xxx.193 Proxying through 91.205.218.64:80: 51.25x.xxx.193 Proxying through 141.0.70.211:8080: 51.25x.xxx.193 Proxying through 51.15.166.107:3128: 51.25x.xxx.193Any idea's on why this is not working?