0

I created a basic coding in visualbasic to download from NSE website.

While the coding still downloads the previous years data, it gives an download error for the current new year.

The RAW URL is https://www.nseindia.com/products/content/equities/equities/archieve_eq.htm If you choose a date (say today) and then select BHAVCOPY report, the site will provide you with a link to download the csv.zip file.

However, if you click on the link directly (https://www.nseindia.com/content/historical/EQUITIES/2017/JAN/cm02JAN2017bhav.csv.zip), the URL returns an error: Access Denied

You don't have permission to access "THE LINK" on this server. Reference #18.11367a5c.1483362327.35d38c1b

What might be the problem with change in year?

Pash
  • 19
  • 1
  • 2
  • I have the working .Net Code, refer the following link https://stackoverflow.com/questions/47033139/how-to-download-nse-bhavcopy-nse-market-closing-price-in-java – sskini Nov 02 '17 at 09:56

2 Answers2

2

i also facing same issue. fixed by adding 2 http header property.

 "User-Agent" : "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.95 Safari/537.11"
 "Referer" : "https://www1.nseindia.com/products/content/equities/equities/archieve_eq.htm"
Akash Shah
  • 596
  • 4
  • 17
0

After a bit tweaking I noticed it was something to do with browser. Blocked the cookies and everything is working fine.

Pash
  • 19
  • 1
  • 2