download zip file with XP and Internet Explorer

General Macro Scheduler discussion

Moderators: Dorian (MJT support), JRL

Post Reply
Automation4Life
Newbie
Posts: 4
Joined: Tue Sep 23, 2008 3:04 pm

download zip file with XP and Internet Explorer

Post by Automation4Life » Tue Sep 23, 2008 3:25 pm

I have a script that downloads a ZIP file from here:
http://www.sws.uiuc.edu/warm/cdflist.asp?y=2008

I navigate to that address, click ALL STATIONS, and the File Download dialog appears.

Everything worked fine (or I changed something without realizing it) until the last Windows XP update. Now if I navigate to that link, it opens the ZIP file as a folder on my machine in C:\Documents and Settings\...\Temporary Internet Files\...

If I right click the ALL STATIONS link, I can manually choose "Save Target As", but I'm uncertain how to automate that.

Any ideas on how to force the file download dialog?

Thank you

Edit: It still works fine on my Vista machine.

Me_again
Automation Wizard
Posts: 1101
Joined: Fri Jan 07, 2005 5:55 pm
Location: Somewhere else on the planet

Post by Me_again » Tue Sep 23, 2008 5:42 pm

Why not do it the easy way? That ALL STATIONS link is to

http://www.sws.uiuc.edu/warm/data/cdfs/ ... ions08.zip

and you can use HTTPRequest> to grab it directly without having to open IE.

(My guess is that the 2009 file will be "09".)

Automation4Life
Newbie
Posts: 4
Joined: Tue Sep 23, 2008 3:04 pm

good idea

Post by Automation4Life » Tue Sep 23, 2008 10:14 pm

That's a nice workaround and it's simpler than what I started with. I appreciate the help.

Me_again
Automation Wizard
Posts: 1101
Joined: Fri Jan 07, 2005 5:55 pm
Location: Somewhere else on the planet

Post by Me_again » Tue Sep 23, 2008 11:21 pm

You're welcome. I use this software for weather related stuff too :wink:

ferque6
Junior Coder
Posts: 20
Joined: Tue Feb 01, 2005 9:21 am

Re: download zip file with XP and Internet Explorer

Post by ferque6 » Mon Dec 29, 2014 2:47 pm

How can I use HTTPRequest> for downloading JPG files from internet and saving them with the same name? There is a lot of such files.

User avatar
Marcus Tettmar
Site Admin
Posts: 7380
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Re: download zip file with XP and Internet Explorer

Post by Marcus Tettmar » Tue Dec 30, 2014 3:41 pm

In order to request the file you must already know it's name, so your script logic would use that same name for the local file.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

ferque6
Junior Coder
Posts: 20
Joined: Tue Feb 01, 2005 9:21 am

Re: download zip file with XP and Internet Explorer

Post by ferque6 » Tue Dec 30, 2014 6:49 pm

For example, I want to download the following link to a pic:

http://photos.vanityfair.com/2014/10/06 ... r-ss03.jpg

and save to a folder named c:\pics\Jennifer_Lawrence

What is the sentence using HTTPRequest?

Thanks

User avatar
JRL
Automation Wizard
Posts: 3501
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Re: download zip file with XP and Internet Explorer

Post by JRL » Tue Dec 30, 2014 7:24 pm

Code: Select all

Let>FileName= c:\pics\Jennifer_Lawrence\J_L_0001.jpg
HTTPRequest>http://photos.vanityfair.com/2014/10/06/5432e75e74ed87dd423a3848_jennifer-lawrence-vanity-fair-11-november-cover-ss03.jpg,FileName,Get,,,

ferque6
Junior Coder
Posts: 20
Joined: Tue Feb 01, 2005 9:21 am

Re: download zip file with XP and Internet Explorer

Post by ferque6 » Tue Dec 30, 2014 7:49 pm

I want the downloaded file to have the same name without put this name twice. What must I do?

Another question, do the macro pause until downloading is complete?

User avatar
JRL
Automation Wizard
Posts: 3501
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Re: download zip file with XP and Internet Explorer

Post by JRL » Tue Dec 30, 2014 9:03 pm

Ok... This works on this particular web page but will likely need to be amended for other web pages. I first downloaded the http://photos.vanityfair.com/2014/10/06 web page and examined the source to see how to parse out the jpg data. Then wrote the code to do that. If you want other web pages you'd need to do the same for each page. Also, be forewarned that web pages are generally changed on a regular basis so your code might work one time then fail the next time you try use it.

And yes the macro pauses at each line including the HttpRequest> line.


Code: Select all

HTTPRequest>http://photos.vanityfair.com/2014/10/06,,Get,,vHttp_Data,,
Separate>vHttp_Data,"name":",vLine
Message>

Let>kk=0
Repeat>kk
  Add>kk,1
  Let>Value=vLine_%kk%
  Separate>Value,.jpg"%comma%",vImage
  SetControlText>Macro Scheduler Message,TMemo,1,%kk% of %vLine_Count%%crlf%%vImage_1%.jpg
  Let>FileName=c:\pics\Jennifer_Lawrence\%vImage_1%.jpg
  HTTPRequest>http://photos.vanityfair.com/2014/10/06/%vImage_1%.jpg,FileName,Get,,,
Until>kk=vLine_Count

ferque6
Junior Coder
Posts: 20
Joined: Tue Feb 01, 2005 9:21 am

Re: download zip file with XP and Internet Explorer

Post by ferque6 » Tue Dec 30, 2014 11:21 pm

Imagine there are many pics and some of them are "jpg", other ones are "gif", other ones are "png".

What can it be done?

Thanks

:D

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts