Created
May 1, 2019 22:52
-
-
Save mIcHyAmRaNe/046be9f1fa91edd68d4aa41acec83eaa to your computer and use it in GitHub Desktop.
get random proxy from proxy-list.download
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# -*- coding: utf-8 -*- | |
import requests | |
import random | |
rq = requests.get('http://www.proxy-list.download/api/v1/get?type=http&anon=elite').text.splitlines() | |
prox = random.choice(rq) | |
proxies = { | |
'http': 'http://'+prox, | |
'https': 'http://'+prox, | |
} | |
print(prox) | |
try: | |
print(' └─────►',requests.get('http://ip.42.pl/raw', proxies=proxies, timeout=15).text) | |
except (ConnectionError, HTTPError, Timeout): | |
print ('\n [x] Server not responding') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment