我有SOCKS5代理 - 104.219.251.135:32832
import socks
s = socks.socksocket()
s.set_proxy(socks.SOCKS5, "104.219.251.135","32832")
s.connect(("www.google.com" , 80))
我发现错误:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python3.5/dist-packages/socks.py", line 100, in wrapper
return function(*args, **kwargs)
File "/usr/local/lib/python3.5/dist-packages/socks.py", line 832, in connect
super(socksocket, self).connect(proxy_addr)
TypeError: an integer is required (got type str)
为什么?如何解决?
如何检查代理的有效性和知道代理类型?