I have started getting an error suddenly while running the code.
Following is the error:
Traceback (most recent call last):
File "C:\Python\lib\site-packages\urllib3\connection.py", line 159, in _new_conn
conn = connection.create_connection(
File "C:\Python\lib\site-packages\urllib3\util\connection.py", line 61, in create_connection
for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM):
File "C:\Python\lib\socket.py", line 918, in getaddrinfo
for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno 11001] getaddrinfo failed
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Python\lib\site-packages\urllib3\connectionpool.py", line 670, in urlopen
httplib_response = self._make_request(
File "C:\Python\lib\site-packages\urllib3\connectionpool.py", line 381, in _make_request
self._validate_conn(conn)
File "C:\Python\lib\site-packages\urllib3\connectionpool.py", line 976, in _validate_conn
conn.connect()
File "C:\Python\lib\site-packages\urllib3\connection.py", line 308, in connect
conn = self._new_conn()
File "C:\Python\lib\site-packages\urllib3\connection.py", line 171, in _new_conn
raise NewConnectionError(
urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPSConnection object at 0x0000013E860174F0>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Python\lib\site-packages\requests\adapters.py", line 439, in send
resp = conn.urlopen(
File "C:\Python\lib\site-packages\urllib3\connectionpool.py", line 724, in urlopen
retries = retries.increment(
File "C:\Python\lib\site-packages\urllib3\util\retry.py", line 439, in increment
raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='m.bseindia.com', port=443): Max retries exceeded with url: /StockReach.aspx?scripcd=534976 (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x0000013E860174F0>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed'))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<pyshell#2>", line 1, in <module>
q = b.getQuote('534976')
File "C:\Python\lib\site-packages\bsedata\bse.py", line 60, in getQuote
return quote.quote(scripCode)
File "C:\Python\lib\site-packages\bsedata\quote.py", line 36, in quote
res = requests.get(baseurl + scripCode, headers=headers)
File "C:\Python\lib\site-packages\requests\api.py", line 76, in get
return request('get', url, params=params, **kwargs)
File "C:\Python\lib\site-packages\requests\api.py", line 61, in request
return session.request(method=method, url=url, **kwargs)
File "C:\Python\lib\site-packages\requests\sessions.py", line 530, in request
resp = self.send(prep, **send_kwargs)
File "C:\Python\lib\site-packages\requests\sessions.py", line 643, in send
r = adapter.send(request, **kwargs)
File "C:\Python\lib\site-packages\requests\adapters.py", line 516, in send
raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPSConnectionPool(host='m.bseindia.com', port=443): Max retries exceeded with url: /StockReach.aspx?scripcd=534976 (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x0000013E860174F0>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed'))