Hi Jason,

> ** Access Error: Cannot open
> /C/WINDOWS/Desktop/rebol031/club_details.sps?id=1.
> ** Where: write file read site/:file

The reason why you are getting the error is because the file name you are
trying to save it under contains illegal characters. The "?" is an illegal
character in Windows (and some other platforms) filenames.

You could use 'trim/with to remove the illegal chars.

foreach file files [write trim/with copy file "?" read site/:file]

Or you could use 'replace if you prefer, to subsitute another value

foreach file files [write replace copy file "?" "$" read site/:file]

Cheers

Allen K

(also in Brisbane, Australia)




REBOL [
> Title: "Download Multiple Pages"
> File: %webgetter.r
> Purpose: {Fetch several web pages and save them as local files.}
> ]
> site: http://www.agu.org.au/club_directory/
> files: [
> %club_details.sps?id=1
> ]
> foreach file files [write to-file trim/with file "?" read site/:file]





----- Original Message -----
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, May 06, 2000 4:24 PM
Subject: [REBOL] getting web pages via script


> ** Access Error: Cannot open
> /C/WINDOWS/Desktop/rebol031/club_details.sps?id=1.
> ** Where: write file read site/:file
> hi
> i hope you can help.....
> i get the above message when i run the following script
> REBOL [
> Title: "Download Multiple Pages"
> File: %webgetter.r
> Purpose: {Fetch several web pages and save them as local files.}
> ]
> site: http://www.agu.org.au/club_directory/
> files: [
> %club_details.sps?id=1
> ]
> foreach file files [write file read site/:file]
>
> i need to get the first forty listings for work so instead of manually
> saving them all, i thought rebol would come to the rescue!!
> i thought i could just tell it to do id 1 then id 2 and so on so i'll need
> to whack a loop in their to somehow.... to count the first 40..anyway..
> the script below works just fine, which is just the default of the same
> directory but when i ask it to get the first record which is id1 that's
> when the problem happens! if i cut and paste the url into a web page it
> works just fine, so i'm thinking that it my be a syntax error on my
part...
> REBOL [
> Title: "Download Multiple Pages"
> File: %webgetter.r
> Date: 20-May-1999
> Purpose: {Fetch several web pages and save them as local files.}
> ]
> site: http://www.agu.org.au/club_directory/
> files: [
> %default.sps
> ]
> foreach file files [write file read site/:file]
> can you pls help
> ps - this is a great product ...where have you guys been hiding!!
> i initally came across it on BeOS and it has since saved me soooo much
> time - thanks :-)
>
>
> Jason Savidge
> IT Manager
> One Stop Entertainment
> Brisbane Australia
> www.onestopent.com.au
>
>

Reply via email to