Alternative Nation
Go Back   Alternative Nation > Lounge > Computers & Technology > Web Dev & Programming

Notices

Reply
 
Thread Tools Rate Thread
Old 19th July 2008, 11:46am   #1
Registered User
 
Join Date: Jul 2008
Posts: 5
Dewajtis is on a distinguished road
VB Script to download series of PDF

Can you help to write a vbs code to download all the pdf files from http server, for example to download all the pdf's from this website: http://eur-lex.europa.eu/JOHtml.do?u...3E:SOM:PL:HTML.
I did something like this:
'========================
'--Zmienne--
sZrodlo = "target site"
sNazwaPliku = "file name"
'---Zmienne---

set oHTTP = WScript.CreateObject("Microsoft.XMLHTTP")
set oFSO = WScript.CreateObject("Scripting.FileSystemObject")

oHTTP.open "GET", sZrodlo, False
oHTTP.send
body8209 = oHTTP.responseBody
set oHTTP = nothing

sOut = ""
For i = 0 to UBound(body8209)
sOut = sOut & chrw(ascw(chr(ascb(midb(body8209,i+1,1)))))
Next

set oTS = oFSO.CreateTextFile(sNazwaPliku, True)
oTS.Write sOut
oTS.Close
set oTS = Nothing
set oFSO = Nothing
'========================
but I can download only one file at a time.
Dewajtis is offline   Reply With Quote
Old 19th July 2008, 11:57am   #2
Trayus Academy Graduate
 
Goth_pixie's Avatar
 
Join Date: Sep 2006
Location: In the cupboard
Posts: 2,564
Goth_pixie infected us, about time we infected themGoth_pixie infected us, about time we infected themGoth_pixie infected us, about time we infected themGoth_pixie infected us, about time we infected them
Re: VB Script to download series of PDF

You really ought to say please.
Goth_pixie is offline   Reply With Quote
Old 19th July 2008, 11:59am   #3
Changed Man V4
 
Join Date: May 2002
Location: Breaking into H
Posts: 32,065
Images: 303
Zooropa is better than HoodyZooropa is better than HoodyZooropa is better than HoodyZooropa is better than HoodyZooropa is better than HoodyZooropa is better than HoodyZooropa is better than HoodyZooropa is better than HoodyZooropa is better than HoodyZooropa is better than HoodyZooropa is better than Hoody
Send a message via MSN to Zooropa
Re: VB Script to download series of PDF

Tricky.

Why does it have to be VBS?
__________________
You just lost The Game
Zooropa is offline   Reply With Quote
Old 19th July 2008, 8:34pm   #4
Registered User
 
Join Date: Jul 2008
Posts: 5
Dewajtis is on a distinguished road
Re: VB Script to download series of PDF

I want it to be as simple as possible. Just a click away. I can't use any compiler. It must be something like vbs.
Dewajtis is offline   Reply With Quote
Old 19th July 2008, 8:38pm   #5
STEVE HOLT!
 
Join Date: May 2001
Location: London
Posts: 5,987
Blog Entries: 1
Zero is a name known to allZero is a name known to allZero is a name known to allZero is a name known to allZero is a name known to allZero is a name known to all
Re: VB Script to download series of PDF

There are tons of Firefox plugins for downloading all the files linked to from a page. No need to code anything.
Zero is offline   Reply With Quote
Old 19th July 2008, 8:42pm   #6
Registered User
 
Join Date: Jul 2008
Posts: 5
Dewajtis is on a distinguished road
Re: VB Script to download series of PDF

It is for use at work. I can't use any plugins. It must be something like vbs. Can anyone give me a clue how to write this sort of code in vbs?
Dewajtis is offline   Reply With Quote
Old 19th July 2008, 8:46pm   #7
STEVE HOLT!
 
Join Date: May 2001
Location: London
Posts: 5,987
Blog Entries: 1
Zero is a name known to allZero is a name known to allZero is a name known to allZero is a name known to allZero is a name known to allZero is a name known to all
Re: VB Script to download series of PDF

So it works, but "you download only one file at a time"?

I'm pretty sure you can't write multithreaded code in VBScript.
Zero is offline   Reply With Quote
Old 19th July 2008, 8:56pm   #8
Registered User
 
Join Date: Jul 2008
Posts: 5
Dewajtis is on a distinguished road
Re: VB Script to download series of PDF

Yes, that is correct. If you look at this page what I gave you will know what I mean. Maybe there is a way to download all pdf's.
Dewajtis is offline   Reply With Quote
Reply

Bookmarks
Digg del.icio.us StumbleUpon Google

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


Pangea 



 Bamboo





Powered by vBadvanced CMPS v3.0.0
Advertisement
   



All times are GMT +0. The time now is 1:44am.

Forums Directory
Copyright 2000-2008, Alternative Nation

SEO by vBSEO 3.1.0 ©2007, Crawlability, Inc.
Page generated in 0.37184 seconds with 18 queries