1. urllib2的opener和handler概念 1.1 Openers: 当你获取一个URL你使用一个opener(一个urllib2.OpenerDirector的实例).正常情况下,我们使用默认opener:通过urlopen.但你能够创建个性的openers.可以用build_opener来创建opener对象.一般可用于需要处理cookie或者不想进行redirection的应用场景(You will want to create openers if you want to f…