爬虫2 urllib3用法

import urllib3
import json # 实例化一个连接池
# http = urllib3.PoolManager()
# res = http.request('get','http://httpbin.org/get')
# res_json = res.data.decode()
# res_dict = json.loads(res_json)
# print(res_dict) # 代理池
proxy = urllib3.ProxyManager('http://123.101.207.160:9999')
res = proxy.request('get','http://httpbin.org/ip')
print(res.data)
上一篇:AFNetworking3.0出现Error Domain=com.alamofire.error.serialization.response Code=-1016 "Request failed: unacceptable


下一篇:Protocol Buffers(3):阅读一个二进制文件