---------------------------------------------------------------------------
KeyboardInterrupt Traceback (most recent call last)
<ipython-input-13-12d16b0bc370> in <module>()
----> 1 call_api()
<ipython-input-11-16f9863eb110> in call_api()
46
47 while True:
---> 48 collect_data(100, offset)
49 offset += 200
50 #print(offset)
<ipython-input-11-16f9863eb110> in collect_data(count, offset)
14
15 BASE_URL = 'https://etherchain.org/api/txs/{}/{}'.format(offset, count)
---> 16 r = requests.get(BASE_URL)
17
18 if r.status_code != 200:
//anaconda/lib/python2.7/site-packages/requests/api.pyc in get(url, params, **kwargs)
70
71 kwargs.setdefault('allow_redirects', True)
---> 72 return request('get', url, params=params, **kwargs)
73
74
//anaconda/lib/python2.7/site-packages/requests/api.pyc in request(method, url, **kwargs)
56 # cases, and look like a memory leak in others.
57 with sessions.Session() as session:
---> 58 return session.request(method=method, url=url, **kwargs)
59
60
//anaconda/lib/python2.7/site-packages/requests/sessions.pyc in request(self, method, url, params, data, headers, cookies, files, auth, timeout, allow_redirects, proxies, hooks, stream, verify, cert, json)
506 }
507 send_kwargs.update(settings)
--> 508 resp = self.send(prep, **send_kwargs)
509
510 return resp
//anaconda/lib/python2.7/site-packages/requests/sessions.pyc in send(self, request, **kwargs)
616
617 # Send the request
--> 618 r = adapter.send(request, **kwargs)
619
620 # Total elapsed time of the request (approximately)
//anaconda/lib/python2.7/site-packages/requests/adapters.pyc in send(self, request, stream, timeout, verify, cert, proxies)
438 decode_content=False,
439 retries=self.max_retries,
--> 440 timeout=timeout
441 )
442
//anaconda/lib/python2.7/site-packages/urllib3/connectionpool.pyc in urlopen(self, method, url, body, headers, retries, redirect, assert_same_host, timeout, pool_timeout, release_conn, chunked, body_pos, **response_kw)
599 timeout=timeout_obj,
600 body=body, headers=headers,
--> 601 chunked=chunked)
602
603 # If we're going to release the connection in ``finally:``, then
//anaconda/lib/python2.7/site-packages/urllib3/connectionpool.pyc in _make_request(self, conn, method, url, timeout, chunked, **httplib_request_kw)
378 try:
379 try: # Python 2.7, use buffering of HTTP responses
--> 380 httplib_response = conn.getresponse(buffering=True)
381 except TypeError: # Python 2.6 and older, Python 3
382 try:
//anaconda/lib/python2.7/httplib.pyc in getresponse(self, buffering)
1119
1120 try:
-> 1121 response.begin()
1122 assert response.will_close != _UNKNOWN
1123 self.__state = _CS_IDLE
//anaconda/lib/python2.7/httplib.pyc in begin(self)
436 # read until we get a non-100 response
437 while True:
--> 438 version, status, reason = self._read_status()
439 if status != CONTINUE:
440 break
//anaconda/lib/python2.7/httplib.pyc in _read_status(self)
392 def _read_status(self):
393 # Initialize with Simple-Response defaults
--> 394 line = self.fp.readline(_MAXLINE + 1)
395 if len(line) > _MAXLINE:
396 raise LineTooLong("header line")
//anaconda/lib/python2.7/socket.pyc in readline(self, size)
478 while True:
479 try:
--> 480 data = self._sock.recv(self._rbufsize)
481 except error, e:
482 if e.args[0] == EINTR:
//anaconda/lib/python2.7/site-packages/urllib3/contrib/pyopenssl.pyc in recv(self, *args, **kwargs)
256 def recv(self, *args, **kwargs):
257 try:
--> 258 data = self.connection.recv(*args, **kwargs)
259 except OpenSSL.SSL.SysCallError as e:
260 if self.suppress_ragged_eofs and e.args == (-1, 'Unexpected EOF'):
//anaconda/lib/python2.7/site-packages/OpenSSL/SSL.pyc in recv(self, bufsiz, flags)
1301 result = _lib.SSL_peek(self._ssl, buf, bufsiz)
1302 else:
-> 1303 result = _lib.SSL_read(self._ssl, buf, bufsiz)
1304 self._raise_ssl_error(self._ssl, result)
1305 return _ffi.buffer(buf, result)[:]
KeyboardInterrupt: