我正在使用很棒的 Requests我的 Python 脚本中的库:
import requests
r = requests.get("some-site.example")
print r.text
我想使用 socks 代理。但是Requests现在只支持HTTP代理。
我该怎么做?
最佳答案
现代方式:
pip install -U requests[socks]
然后
import requests
resp = requests.get('http://go.to',
proxies=dict(http='socks5://user:pass@host:port',
https='socks5://user:pass@host:port'))
关于python - 如何通过 socks 代理使 python 请求工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12601316/