python 3的代理库
py-prox的Python项目详细描述
py_代理
python代理管理器。
请认真使用。
始终尊重网站的robots.txt
兼容性
此库与Python3兼容
依赖关系
此库依赖于:
- 请求
- 美化组4
安装
pip install py_proxy
功能
- 测试代理并获取有关代理的详细信息
- 同时验证所有获取的代理:
示例
fromproxyimportProxyproxy=Proxy()# getting the current proxycur_proxy=proxy.proxy# testing the current proxyres=proxy.test_proxy(cur_proxy)ifres==1:print("success!")else:print("failure!")# cycling the proxy to a new proxy from the poolproxy.cycle()# filtering proxies by a country codeproxy=Proxy("US")#gets US only proxies from the pool# automatically validating proxies after fetching themproxy=Proxy(validate_proxies=True)# format a proxy for use with requests libraryip="100.100.100.100"#example ip, not realport="1989"#example port, not realaddr=[ip,port]proxies=proxy.format_proxy(addr)#returns the requests proxies dictionary# validating all proxies concurrentlyproxy.validate_proxies()# cycling through valid only proxiesproxy.cycle(valid_only=True)
许可证
您可以自由使用这个根据MIT-LICENSE授权的软件包
贡献
贡献总是值得赞赏的。
如果您有贡献,请记住更新自述文件。
如果你的捐款被接受,你将被记入贷方。
原作者
贡献者
Berkkarahan-添加了多线程代理验证