python报错信息type 'exceptions.AttributeError'是什么意思,,python报错Exce
python报错信息type 'exceptions.AttributeError'是什么意思,,python报错Exce
python
报错
Exception in thread Thread-1 (most likely raised during interpreter shutdown):Traceback (most recent call last): File "/usr/lib/python2.6/threading.py", line 532, in __bootstrap_inner File "/usr/lib/python2.6/threading.py", line 484, in run File "dxcad.py", line 243, in threadget File "dxcad.py", line 181, in gethtml File "/usr/lib/python2.6/urllib2.py", line 126, in urlopen File "/usr/lib/python2.6/urllib2.py", line 391, in open File "/usr/lib/python2.6/urllib2.py", line 409, in _open File "/usr/lib/python2.6/urllib2.py", line 369, in _call_chain File "/usr/lib/python2.6/urllib2.py", line 1190, in http_open File "/usr/lib/python2.6/urllib2.py", line 1164, in do_open<type 'exceptions.AttributeError'>: 'NoneType' object has no attribute 'error'
代码
def gethtml(url): encoding_support = ContentEncodingProcessor prodom=proxylist[random.randint(0,proxn)] proxy_support = urllib2.ProxyHandler({'http':prodom}) opener = urllib2.build_opener(proxy_support,encoding_support,urllib2.HTTPHandler) urllib2.install_opener(opener) try: bpanhtml = urllib2.urlopen(url,timeout = 2).read() except Exception,e: print e return gethtml(url) return bpanhtml
求教
不要在线程中 install_opener
编橙之家文章,
相关内容
- Python可以做局域网线聊天类型的网站吗?,python局域网
- python3.3有哪些特别好用的模块,python3.3模块,python3.3对内
- 与三方网站相关要如何选择合适的Python WSGI服务器,p
- Python模拟登录人人抓取内容页问题,python模拟人人抓取
- 新手写的python简单服务器和客户端程序,纠错,python客户
- python logging日志级别设置没有效果?,pythonlogging,impor
- ipython notebook 导入numpy异常如何解决,ipythonnumpy,我在s
- python能实现区域找图功能吗?,python区域,请问用什么方
- Vim如何设置syntastic插件使用python3的解释器?,syntasti
- Python namespace应该如何理解,pythonnamespace,python爱好者们
评论关闭