Advertisement
Guest User

Untitled

a guest
Apr 16th, 2018
315
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. import requests
  2.  
  3. proxies = {
  4. 'http': 'http://user:pass@10.10.1.0:3128',
  5. 'https': 'http://user:pass@10.10.1.0:3128',
  6. }
  7.  
  8. # Create the session and set the proxies.
  9. s = requests.Session()
  10. s.proxies = proxies
  11.  
  12. # Make the HTTP request through the session.
  13. r = s.get('http://www.showmemyip.com/')
  14.  
  15. # Check if the proxy was indeed used (the text should contain the proxy IP).
  16. print(r.text)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement