requests.exceptions.TooManyRedirects: Exceeded 30 redirects.
techpranav opened this issue · comments
For below code,
from nsepy import get_history from datetime import date df = get_history(symbol="SBIN", start=date(2023,1,1), end=date(2023,1,5))
getting TooManyRedirects exception.
`C:\ProgramData\Anaconda3\envs\NSE-39\python.exe "D:\OneDrive - Technia AB\Learn\DSGS\Development\Python\NSE\Test.py"
Traceback (most recent call last):
File "D:\OneDrive - Technia AB\Learn\DSGS\Development\Python\NSE\Test.py", line 3, in
df = get_history(symbol="SBIN", start=date(2023,1,1), end=date(2023,1,5))
File "C:\Users\prsh01\AppData\Roaming\Python\Python39\site-packages\nsepy\history.py", line 138, in get_history
return get_history_quanta(**kwargs)
File "C:\Users\prsh01\AppData\Roaming\Python\Python39\site-packages\nsepy\history.py", line 143, in get_history_quanta
df = url_to_df(url=url,
File "C:\Users\prsh01\AppData\Roaming\Python\Python39\site-packages\nsepy\history.py", line 151, in url_to_df
resp = url(**params)
File "C:\Users\prsh01\AppData\Roaming\Python\Python39\site-packages\nsepy\commons.py", line 167, in call
return self.session.get(url, params=kwargs, proxies = self.proxy )
File "C:\ProgramData\Anaconda3\envs\NSE-39\lib\site-packages\requests\sessions.py", line 600, in get
return self.request("GET", url, **kwargs)
File "C:\ProgramData\Anaconda3\envs\NSE-39\lib\site-packages\requests\sessions.py", line 587, in request
resp = self.send(prep, **send_kwargs)
File "C:\ProgramData\Anaconda3\envs\NSE-39\lib\site-packages\requests\sessions.py", line 723, in send
history = [resp for resp in gen]
File "C:\ProgramData\Anaconda3\envs\NSE-39\lib\site-packages\requests\sessions.py", line 723, in
history = [resp for resp in gen]
File "C:\ProgramData\Anaconda3\envs\NSE-39\lib\site-packages\requests\sessions.py", line 191, in resolve_redirects
raise TooManyRedirects(
requests.exceptions.TooManyRedirects: Exceeded 30 redirects.
Process finished with exit code 1
`
@swapniljariwala please look into this on an urgent basis.
Yes, facing the same issue. Kindly please look into this asap
Use this insted : NSE-HISTORY-SCRAPER