Unable to detemine download link

jackgreat

Distinguished
Jun 26, 2006
256
0
18,780
Hello Guys,

I download a file containing stock market data from a website. Basically I open the webpage and there is a link View in Excel (top most right) and when I click on it the browser asks me to where to save the file.

After the file is saved I can view it. It is a csv file and is generated every day. So the filename is specific to a date.

I want to write a program that can download the file automatically but I am unable to determine the download link. I tried to check this using IE and DAP but the download link appears as the webpage name. Plus its unable to download through DAP.

Can you guys determine download link or tell me how can I do it otherwise I have to manually do it everyday.

The site address is : http://www.mcxindia.com/SitePages/BhavCopyDateWise.aspx

Here click on view in excel (topmost right) allows us to save file to our system.

Thank you,

Cheers,
Jack
 

jackgreat

Distinguished
Jun 26, 2006
256
0
18,780


In vb.net if we use the web browser control then after page loads the code below does the trick and at least save dialog box appears.
webBrowser.Document.InvokeScript("__doPostBack", new object[]{"btnLink_Excel", ""});

The only thing is the save dialog box has to be handled manually. Can we automate the whole thing.