• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Downloading .csv file via Javascript link
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Downloading .csv file via Javascript link


  • Subject: Re: Downloading .csv file via Javascript link
  • From: JJ <email@hidden>
  • Date: Fri, 07 Dec 2001 21:00:38 +0100

> Hi - I'm trying to AppleScript Netscape Navigator v4.7 on Mac OS 9.1 to
> download a file from a website, or alternatively use the URL Access
> Scripting to do this. The site in question requires a password to be entered
> into a field on the web page and then you can click a Javascript link which
> generates a .csv file that is downloaded.

What does it mean "generates"? Doesn't exists the file before clicking?
Do you know the password?

If you do, then the url would be anything such as:
http://username:email@hidden/directory/

And, using URL Access:
download the_url to file_path

Communicator:
OpenURL the_url to file_path

If you provide the URL as "PROTOCOL://USERNAME:PASSWORD@URL/PATH/file.csv",
you shouldn't need fill the form Java-parsed (if it's a
protected-directory).
Otherwise, you could code this:

OpenURL the_url to file_path post data "PASSWORD_FIELD_NAME=PASSWORD"

> I can't use Internet Explorer as it just opens the .csv file in the browser
> window; Netscape however just downloads the file immediately. I'm not sure
> if URL Access Scripting can do what I want - this would be my preferred
> method if possible. Does anybody know whether URL Access Scripting can
> download a file that is linked via Javascript?

IE should work, too (replace "post data" using "FormData")
URL Access, replace "post data" using "form data"

Hope this helps.

JJ


  • Prev by Date: URL Access Scripting
  • Next by Date: Re: Do I need a newer version of Applescript (was Re: interesting discovery)
  • Previous by thread: Re: Downloading .csv file via Javascript link
  • Next by thread: Re: Do I need a newer version of Applescript (was Re: interesting discovery)
  • Index(es):
    • Date
    • Thread