|

楼主 |
发表于 2016-2-29 11:17:55
|
显示全部楼层
我改了用户名、密码和URL,发现还有问题,报错信息如下:
(注:windows安全是域账号,会不会是这个问题有影响?我在用户名前加和没加 域名\test都报同样错误)
E:\py>python pyweb_sps2.py
Traceback (most recent call last):
File "pyweb_sps2.py", line 36, in <module>
print Func(url, username, password)
File "pyweb_sps2.py", line 21, in Func
opener.open(url)
File "C:\Python27\lib\urllib2.py", line 437, in open
response = meth(req, response)
File "C:\Python27\lib\urllib2.py", line 550, in http_response
'http', request, response, code, msg, hdrs)
File "C:\Python27\lib\urllib2.py", line 475, in error
return self._call_chain(*args)
File "C:\Python27\lib\urllib2.py", line 409, in _call_chain
result = func(*args)
File "C:\Python27\lib\urllib2.py", line 558, in http_error_default
raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
urllib2.HTTPError: HTTP Error 401: Unauthorized
|
|