Sachin Gupta
Sachin Gupta

Reputation: 15

URL not loading in pd.read_csv however the file is read openly from browser

I am trying to get a csv using a link "https://nsearchives.nseindia.com/content/equities/eq_band_changes_16072024.csv" but it is not downloading.

`import pandas as pd url_circuit_band_changes = f"https://nsearchives.nseindia.com/content/equities/eq_band_changes_{time_now}.csv"

url_circuit_bands = f"https://nsearchives.nseindia.com/content/equities/sec_list_16072024.csv"

stocks_circuit_limits = pd.read_csv(url_circuit_bands)`

Upvotes: 0

Views: 22

Answers (1)

Divyank
Divyank

Reputation: 1057

You can use Python Library as an alernative instead doing it all manually to retrieve csv files for Historical Data:

pip install jugaad-data pandas

from datetime import date
from jugaad_data.nse import bhavcopy_save, full_bhavcopy_save, bhavcopy_fo_save, bhavcopy_index_save

bhavcopy_save(date(2020,1,1), "/path/to/directory")
full_bhavcopy_save(date(2020,1,1), "/path/to/directory")
bhavcopy_fo_save(date(2020,1,1), "/path/to/directory")
bhavcopy_index_save(date(2020,1,1), "/path/to/directory")

Ref Link: https://marketsetup.in/documentation/jugaad-data/historical/

Upvotes: 0

Related Questions