【发布时间】:2015-09-27 19:02:49
【问题描述】:
执行以下行时出现错误:
print urllib.urlopen('http://'+dns+'/password?passwd='+PASSWORD).read
错误:
IOError: ('http protocol error', 0, 'got a bad status line', None)
但是,webbrowser.open_new 可以正常工作
【问题讨论】:
-
dns是什么?你也需要打电话给.read() -
你为什么使用 urllib 而不是 Requests?您使用的方法也已贬值docs.python.org/2/library/urllib.html#high-level-interface