Re: POST Format
Re: POST Format
- Subject: Re: POST Format
- From: Doug McNutt <email@hidden>
- Date: Thu, 18 Sep 2003 16:08:33 -0600
At 22:13 -0700 9/17/03, Alan Kimelman wrote:
>
I know that if I CURL and download a document from a URL, I lose my links. My question is how do I use applescript to tell Safari to access a URL and post various text items such as name, personal identification number and password? I want to access live links on the page.
curl can POST data but you need to format it yourself. The way I have done it is to run something like iCab which can be told to report all transactions in a log file. Turn on the log. Go through the normal login procedure, and then turn off the log and open it in a text editor. You will find full URLs for the relative links.
Using the various curl options such as saving cookie and other HTTP header information you can get logged in using curl and then download things like your broker or banker's statements without using a browser. perl than makes short work of picking the stuff you want out of the HTML data.
AppleScript makes a nice way to persuade Finder to execute the shell script that you will have to write but sending a request to Safari or another browser in order to continue is doomed to failure. The browser has no way to be informed of the cookies and other stuff you picked out of the HTTP header sent to curl. It will always want to start over and get its own unique code as a cookie from the server..
curl is scriptable only in that it will respond to a "do shell script" request. It's -H option to save the HTTP header so you can send it back may not work too well with repeated "do shell script" invocations from AppleScript. You really need a working directory and PATH that stick around between calls.
<
ftp://ftp.macnauchtan.com/BrokerageCrack/> for a fairly old sample without AppleScript.
--
--> There are 10 kinds of people: those who understand binary, and those who don't <--
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.
References: | |
| >POST Format (From: Alan Kimelman <email@hidden>) |