我没能通过我当地的Tor代理来做头部请求
import httplib
host = 'www.heise.de'
inputfilename="/newsticker/classic/"
conn = httplib.HTTPSConnection("127.0.0.1", 9151)
conn.set_tunnel(host, 443)
conn.request("HEAD", inputfilename)
res = conn.getresponse()
print res
我收到很多错误信息,正确的语法是什么?在
你的torproxy是一个SOCKS代理,httplib不支持它。在
您可以使用
requests
的最新版本(无论如何,httplib
建议使用它而不是它本身)。在安装
然后,您可以:
相关问题 更多 >
编程相关推荐