- 帖子
- 2
- 精华
- 0
- 积分
- 14
- 阅读权限
- 10
- 注册时间
- 2014-4-28
- 最后登录
- 2014-8-4
|
楼主点赞 下载下来学习
我在运行时爆了一个HTTPError,详细信息如下:
----------------------------------------
糗百命令行版——Byron
一入糗百深似海,从此节操是路人
输入"q"退出程序
----------------------------------------
输入要看的页数1~280:1
------------------第1页------------------
url is :http://www.qiushibaike.com/week/page/1
Traceback (most recent call last):
File "qb.py", line 48, in <module>
if_qb()
File "qb.py", line 41, in if_qb
for_qb()
File "qb.py", line 30, in for_qb
qiubai(page)
File "qb.py", line 14, in qiubai
html = urllib2.urlopen(url).read()
File "C:\Python27\lib\urllib2.py", line 127, in urlopen
return _opener.open(url, data, timeout)
File "C:\Python27\lib\urllib2.py", line 410, in open
response = meth(req, response)
File "C:\Python27\lib\urllib2.py", line 523, in http_response
'http', request, response, code, msg, hdrs)
File "C:\Python27\lib\urllib2.py", line 448, in error
return self._call_chain(*args)
File "C:\Python27\lib\urllib2.py", line 382, in _call_chain
result = func(*args)
File "C:\Python27\lib\urllib2.py", line 531, in http_error_default
raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
urllib2.HTTPError: HTTP Error 502: Proxy Error ( The specified network name
o longer available. )
----------------------------------------
其中url是我输出的urlopen的地址,改地址在浏览器可以打开
想问一下是否是我本地上网用的是代理的原因?如果是怎么解决?
如果不是这个原因应该怎么办?
|
|