We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 813b38d commit f0eb2bfCopy full SHA for f0eb2bf
2 files changed
python/requests-proxy.py
@@ -0,0 +1,7 @@
1
+import requests
2
+proxies = {
3
+ # USERNAME:PASSWORD is optional if you have IP authentication
4
+ 'http': 'http://USERNAME:PASSWORD@HOST:PORT',
5
+ 'https': 'http://USERNAME:PASSWORD@HOST:PORT'
6
+}
7
+response = requests.get('http://example.com', proxies=proxies)
python/requests-random-proxy.py
@@ -0,0 +1,9 @@
+import random
+proxy_choices = ['HOST1:PORT', 'HOST2:PORT']
+proxy = random.choice(proxy_choices)
+ 'http': f'http://{proxy}',
+ 'https': f'http://{proxy}'
8
9
0 commit comments