Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import urllib3
- import random
- # Define a list of proxy URLs
- proxy_list = [
- "http://8.219.97.248:80",
- "http://50.168.49.109:80",
- # Add more proxy URLs as needed
- ]
- # Randomly select a proxy from the list
- proxy_url = random.choice(proxy_list)
- # Create a Proxy Manager instance using the random proxy
- proxy = urllib3.ProxyManager(proxy_url)
- # Make GET request through the proxy
- response = proxy.request("GET", "http://httpbin.io/ip")
- #Print the returned data
- print(response.data)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement