我正在尝试将 Tor 与 python 和 urllib2 一起使用并且被卡住了。以下
print opener.open('http://check.torproject.org/').read()
和
telnet 127.0.0.1 9051
给我以下错误:
514 Authentication Required.
这是我要使用的代码: 但是我在 urllib2.urlopen 调用中收到相同的 514 身份验证错误。
import urllib2
# using TOR !
proxy_support = urllib2.ProxyHandler({"http" : "127.0.0.1:9051"} )
opener = urllib2.build_opener(proxy_support)
urllib2.install_opener(opener)
# every urlopen connection will then use the TOR proxy like this one :
urllib2.urlopen('http://www.google.com').read()
关于为什么会发生这种情况的任何建议?
Tor Vidalia 浏览器 -> 设置 -> 高级:身份验证设置为“随机生成”
我正在使用 Python 2.65 urllib2 Tor