摘要: #urllib2设置超时 #获取网页的源码 def getHtml(url,i): if i > 2: return try: req = urllib2.Request(url) time.sleep(1) req.add_header('User-Agent', 'Mozilla/5.0 (Windows NT ... 阅读全文
posted @ 2016-03-18 11:33 kingrain 阅读(855) 评论(0) 推荐(0) 编辑