Advertisement
dereksir

Untitled

Oct 2nd, 2023
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.50 KB | None | 0 0
  1. import urllib3
  2. import random
  3.  
  4. # Define a list of proxy URLs
  5. proxy_list = [
  6.     "http://8.219.97.248:80",
  7.     "http://50.168.49.109:80",
  8.     # Add more proxy URLs as needed
  9. ]
  10.  
  11. # Randomly select a proxy from the list
  12. proxy_url = random.choice(proxy_list)
  13.  
  14. # Create a Proxy Manager instance using the random proxy
  15. proxy = urllib3.ProxyManager(proxy_url)
  16.  
  17. # Make GET request through the proxy
  18. response = proxy.request("GET", "http://httpbin.io/ip")
  19.  
  20. #Print the returned data
  21. print(response.data)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement