---------------------------------------------------------------------------
URLError Traceback (most recent call last)
<ipython-input-8-473eb9e21f63> in <module>()
8 print("Completed")
9
---> 10 download_file("http://progra.usm.cl/Archivos/certamenes/Libro_prograRB.pdf")
<ipython-input-8-473eb9e21f63> in download_file(download_url)
2
3 def download_file(download_url):
----> 4 response = urllib2.urlopen(download_url)
5 file = open("document.pdf", 'wb')
6 file.write(response.read())
/usr/lib/python2.7/urllib2.pyc in urlopen(url, data, timeout)
125 if _opener is None:
126 _opener = build_opener()
--> 127 return _opener.open(url, data, timeout)
128
129 def install_opener(opener):
/usr/lib/python2.7/urllib2.pyc in open(self, fullurl, data, timeout)
402 req = meth(req)
403
--> 404 response = self._open(req, data)
405
406 # post-process response
/usr/lib/python2.7/urllib2.pyc in _open(self, req, data)
420 protocol = req.get_type()
421 result = self._call_chain(self.handle_open, protocol, protocol +
--> 422 '_open', req)
423 if result:
424 return result
/usr/lib/python2.7/urllib2.pyc in _call_chain(self, chain, kind, meth_name, *args)
380 func = getattr(handler, meth_name)
381
--> 382 result = func(*args)
383 if result is not None:
384 return result
/usr/lib/python2.7/urllib2.pyc in http_open(self, req)
1212
1213 def http_open(self, req):
-> 1214 return self.do_open(httplib.HTTPConnection, req)
1215
1216 http_request = AbstractHTTPHandler.do_request_
/usr/lib/python2.7/urllib2.pyc in do_open(self, http_class, req)
1182 except socket.error, err: # XXX what error?
1183 h.close()
-> 1184 raise URLError(err)
1185 else:
1186 try:
URLError: <urlopen error [Errno -2] Name or service not known>