Forums

accessing www.nseindia.com problem

when I try to access www.nseindia.com, from request module it show error , how to resolve this

During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/sanwebid/OI_1.py", line 26, in <module> nifty_oi_json = requests.get(url_nifty, headers=headers).json() File "/usr/lib/python3.7/site-packages/requests/api.py", line 75, in get return request('get', url, params=params, kwargs) File "/usr/lib/python3.7/site-packages/requests/api.py", line 60, in request return session.request(method=method, url=url, kwargs) File "/usr/lib/python3.7/site-packages/requests/sessions.py", line 533, in request resp = self.send(prep, send_kwargs) File "/usr/lib/python3.7/site-packages/requests/sessions.py", line 646, in send r = adapter.send(request, kwargs) File "/usr/lib/python3.7/site-packages/requests/adapters.py", line 510, in send raise ProxyError(e, request=request) requests.exceptions.ProxyError: HTTPSConnectionPool(host='www.nseindia.com', port=443): Max retries exceeded with url: /api/option-chain-indices?symbol=NIFTY (Caused by ProxyError('Cannot connect to proxy.', OSError('Tunnel connection failed: 403 Forbidden')))

We do not let free account to access pages from outside the whitelist. See https://www.pythonanywhere.com/whitelist/ We whitelist only public, documented APIs.

I am a paid user and I am still not able to access the same, account type: "Hacker"

Make sure that you're doing it from a console that you've created since you upgraded. Old consoles will be using the settings from before you upgraded.