Jump to content
Sign in to follow this  
safdar19

How to download from a website by manipulating the ulr

Recommended Posts

safdar19

Hello friends.

I am trying to automate downloading from the website www.bseindia.com

the ulr is :::

http://www.bseindia.com/stockinfo/stockprc2_excel.aspx?scripcd=512093&FromDate=09/18/2000&ToDate=09/18/2010&OldDMY=D&ScripName=CRANES

I want to create an application which should ask the user to enter the script id and date range.

It should have the capability to import the list of script ids from a text file, and run at least run 5 threads of the ulr simultaneously.

In the above ulr the script id is 512093 and the date range is from 09/18/2000 to 0918/2010.

Is it possible to write a small programme ?

Safdar

Share this post


Link to post
Share on other sites
seandisanti

yes it's possible, easy even. Shouldn't take you more than 5 minutes once you've researched

InputBox()

Run()

maybe @ComSpec

Share this post


Link to post
Share on other sites
Kalin

Hello friends.

I am trying to automate downloading from the website www.bseindia.com

the ulr is :::

http://www.bseindia.com/stockinfo/stockprc2_excel.aspx?scripcd=512093&FromDate=09/18/2000&ToDate=09/18/2010&OldDMY=D&ScripName=CRANES

I want to create an application which should ask the user to enter the script id and date range.

It should have the capability to import the list of script ids from a text file, and run at least run 5 threads of the ulr simultaneously.

In the above ulr the script id is 512093 and the date range is from 09/18/2000 to 0918/2010.

Is it possible to write a small programme ?

Safdar

Lurk the helpfile some more, find the topic type about what you're trying to do.

I'm sure there is a function or UDF for this.

Share this post


Link to post
Share on other sites
safdar19

I have used inetget() with success.

Inetget("http://www.bseindia.com/stockinfo/stockprc2_excel.aspx?scripcd=512093&FromDate=01/18/2010&ToDate=09/18/2010&OldDMY=D&ScripName=CRANES","E:\data\512093.csv")

It has given me a great deal of pleasure, as, me being a compleate newbee, this is my first ever code.

Now I will try to incorporate it somehow in to inputbox().

Thanks for the suggestions.

Safdar

Share this post


Link to post
Share on other sites
safdar19

Kindly Help as I am not able to figure out how to replace "scripcd=512093" from the url to user defined input using iputbox()

$scripcd = InputBox("Question", "Enter the scrip Id")

when the user enters , say, 500410 the "scripcd=512093" in the url should change to 500410

http://www.bseindia.com/stockinfo/stockprc2_excel.aspx?scripcd=512093&FromDate=09/18/2000&ToDate=09/18/2010&OldDMY=D&ScripName=CRANES

Safdar

Share this post


Link to post
Share on other sites
KurogamineNox

Try this

$scripcd = "scripcd=" & InputBox("Question", "Enter the scrip Id")

MsgBox(4096, "Info", $scripcd);Note this just shows what it is

Share this post


Link to post
Share on other sites
seandisanti

when the user enters , say, 500410 the "scripcd=512093" in the url should change to 500410

http://www.bseindia.com/stockinfo/stockprc2_excel.aspx?scripcd=512093&FromDate=09/18/2000&ToDate=09/18/2010&OldDMY=D&ScripName=CRANES

Safdar

you could do like...

$firsturl = "http://www.bseindia.com/stockinfo/stockprc2_excel.aspx?scripcd=512093&FromDate=09/18/2000&ToDate=09/18/2010&OldDMY=D&ScripName=CRANES"
inetget(StringReplace($firsturl,"512093",InputBox("Scripcd","prompt"))

that assumes they're only going to give you the number you're looking for, and only the number has to change...

you could also do like...

$scripcd = InputBox("Question", "Enter the scrip Id")
_IECreate("http://www.bseindia.com/stockinfo/stockprc2_excel.aspx?scripcd=" & $scripcd & "&FromDate=09/18/2000&ToDate=09/18/2010&OldDMY=D&ScripName=CRANES")

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×