摘要:
判断网络是否连接正常:#coding:utf-8import urllib2import systry: request = urllib2.Request('http://www.baidu.com') opener = urllib2.build_opener() f= ope... 阅读全文
摘要:
应用例子:#coding:utf-8import urllib2request = urllib2.Request('http://blog.csdn.net/nevasun')#在请求加上头信息,伪装成浏览器访问request.add_header('User-Agent','Mozilla/5.... 阅读全文