Re: using applescript to navigate a browser
Re: using applescript to navigate a browser
- Subject: Re: using applescript to navigate a browser
- From: Doug McNutt <email@hidden>
- Date: Mon, 30 Sep 2013 18:05:42 -0600
At 17:49 -0500 9/30/13, Joseph J Alotta wrote:
>I am trying to write an applescript program to log onto a website, navigate pages to a link and
>click the link to download a file.
>
>Please email me some example programs that do this sort of thing. I can log in okay, but I have
>difficulty telling the browser where to click.
>
>Please send me some examples.
Have a look at the curl tool that is probably already on your Mac <http://curl.haxx.se/docs/faq.html>. You have to call it with a Do Shell Script from Applescript and it will accept a URL and download the source without any interpretation or automatic access to other files that a browser would do. You can give curl a -o argument to tell it where to store the web page or you can accept the whole page as STDOUT.
Looking at the HTML source of the starting page it's usually a search for a text string with wild cards followed by some substitutions to figure the URL for the page you want.
I do that kind of thing regularly for the likes of receiving stock quotes but - sheepish confession - I prefer perl to Applescript for finding links in the first page that I want to read in a second request. Ask off line using username dmcnutt at the same domain if you would like some samples of that.
--
1801 - Joseph Marie Jacquard uses punch cards to instruct a loom to weave "hello, world" into a tapestry.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden