我有 Tor 运行和一个 python 脚本来获取网页:
socks.setdefaultproxy(socks.PROXY_TYPE_SOCKS5, "127.0.0.1", 9050)
socket.socket = socks.socksocket
print urllib2.urlopen(URL).read()
但是,如果 URL 是
http://localhost/some_page.html
我收到以下错误:
raise Socks5Error(ord(resp[1]),_generalerrors[ord(resp[1])])
TypeError: __init__() takes exactly 2 arguments (3 given)
有人可以向我解释到底发生了什么吗?
谢谢你。