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.
I
Any idea's on why this is not working?
Here's my test code.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
#!/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) return session, proxy for i in range ( 5 ): s, proxy = get_session(proxies) try : print ( f "Proxying through {proxy}:" , ) except Exception as e: continue |
1 2 3 4 5 |
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. 193 |