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.

i am facing the same issue

Traceback (most recent call last): File "<stdin>", line 4, in <module> File "/home/itsram90/.local/lib/python3.10/site-packages/jugaad_data/nse/archives.py", line 74, in bhavcopy_save text = self.bhavcopy_raw(dt) File "/home/itsram90/.local/lib/python3.10/site-packages/jugaad_data/nse/archives.py", line 15, in unzipper r = function(args, kwargs) File "/home/itsram90/.local/lib/python3.10/site-packages/jugaad_data/nse/archives.py", line 65, in bhavcopy_raw r = self.get("bhavcopy", yyyy=yyyy, MMM=MMM, dd=dd) File "/home/itsram90/.local/lib/python3.10/site-packages/jugaad_data/nse/archives.py", line 56, in get self.r = self.s.get(url, timeout=self.timeout) File "/home/itsram90/.local/lib/python3.10/site-packages/requests/sessions.py", line 602, in get return self.request("GET", url, kwargs) File "/home/itsram90/.local/lib/python3.10/site-packages/requests/sessions.py", line 589, in request resp = self.send(prep, send_kwargs) File "/home/itsram90/.local/lib/python3.10/site-packages/requests/sessions.py", line 703, in send r = adapter.send(request, *kwargs) File "/home/itsram90/.local/lib/python3.10/site-packages/requests/adapters.py", line 532, in send raise ReadTimeout(e, request=request) requests.exceptions.ReadTimeout: HTTPSConnectionPool(host='nsearchives.nseindia.com', port=443): Read timed out. (read timeout=4)

i am upgraded paid user. killed all my running bash and console sessions and tried many times. ping to host is working but python is through this error , can you please help /.

It's possible that nseindia.com block access from our machines. It may be based on IP address or country, but there is not really anything that we can do about it.