NSEPython
nsepythonserver not fetching option chain data
When I run this:
from nsepythonserver import *
# from nsepython import *
logging.basicConfig(level=logging.DEBUG)
oi_data, ltp, crontime = oi_chain_builder("NIFTY","latest","full")
print(oi_data)
print(ltp)
print(crontime)
I get this error:
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
However, no error , if I change the import statement to the old one,
"from nsepythonserver import * to --> from nsepython import *"
Full Error:
curl: option --compressed: the installed libcurl version doesn't support this
curl: try 'curl --help' for more information
curl: option --compressed: the installed libcurl version doesn't support this
curl: try 'curl --help' for more information
curl: option --compressed: the installed libcurl version doesn't support this
curl: try 'curl --help' for more information
Traceback (most recent call last):
File "C:\Workspace\Trading\tradingview_websockets\tradingview-scraper\oichain.py", line 28, in <module>
oi_data, ltp, crontime = oi_chain_builder("NIFTY","latest","full")
File "C:\python\PYTHON~2\lib\site-packages\nsepythonserver\rahu.py", line 93, in oi_chain_builder
payload = nse_optionchain_scrapper(symbol)
File "C:\python\PYTHON~2\lib\site-packages\nsepythonserver\rahu.py", line 85, in nse_optionchain_scrapper
payload = nsefetch('https://www.nseindia.com/api/option-chain-indices?symbol='+symbol)
File "C:\python\PYTHON~2\lib\site-packages\nsepythonserver\rahu.py", line 31, in nsefetch
output=json.loads(output)
File "C:\python\PYTHON~2\lib\json\__init__.py", line 346, in loads
return _default_decoder.decode(s)
File "C:\python\PYTHON~2\lib\json\decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "C:\python\PYTHON~2\lib\json\decoder.py", line 355, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
Update:
Randomly getting this error, even with : from nsepython import *
Error:
raise RequestsJSONDecodeError(e.msg, e.doc, e.pos)
requests.exceptions.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
- Bug Reporting
Will using a ROTATING PROXY be a good option to integrate with nsepythonserver ?
Reference: Rotating Proxies For Web Requests in Python - YouTube
nsepythonserver Reference: [Update] NSEPython not working in AWS, Google Cloud and WebServers - #23 by dexter