验证中...
Languages: Python
Categories: 网络技术
Latest update 2019-07-23 23:28
gistfile1.txt
Raw Copy
def getOutIP(proxies=None):
session = requests.session()
url = 'http://ip.42.pl/raw'
try:
print('get out ip running .......')
url = 'https://www.taobao.com/help/getip.php'
if (proxies==None):
r = session.get(url)
else:
r = session.get(url, proxies=proxies)
ip = r.text
ip = ip.replace('ipCallback({ip:"', "").replace('"})', '')
except Exception as e:
print(e)
if (proxies==None):
r = session.get(url)
else:
r = session.get(url, proxies=proxies)
ip = r.text
return ip

Comment list( 0 )

You need to Sign in for post a comment

Help Search