Open a web page needing authentication

Hi
Newbie question…

I want to download a web page which is requires authentication.
I have tried …
tell application “URL Access Scripting” to download target_URL to file fPath ¬
replacing yes form data {“User”, “PW”}

This doesn’t seem to work I just get the following error…
“URL Access Scripting got an error: Can’t make some data into the expected type.”
Any ideas??

Many thanks.

I don’t have a lot of experience with this but here’s what I use to access my router (it requires authentication).

set user_ to "username"
set password_ to "password"
set targetURL to "http://" & user_ & ":" & password_ & "@" & "restOfURL"

tell application "URL Access Scripting" to download target_URL to file fPath ¬
	replacing yes

It’s probably also possible to use curl. Type ‘man curl’ in a Terminal window for all of the details. I have little experience with curl but it seems that it is becoming very popular among AppleScripters.