搭建代理池

一、github上下载开源项目:git clone git@github.com:jhao104/proxy_pool.git

二、修改配置文件(redis配置等)

三、启动代理ip爬虫程序:python proxyPool.py schedule

四、启动代理ip提供服务:python proxyPool.py server

五、使用代理:

# 从代理池提供ip接口随机获取一个ip
requests.get("http://127.0.0.1:5010/get/").json()
# 删除一个无效代理ip
requests.get("http://127.0.0.1:5010/delete/?proxy={}".format(proxy))
原文地址:https://www.cnblogs.com/caoyu080202201/p/13433108.html