Re: Getting a link from a safari window
Re: Getting a link from a safari window
- Subject: Re: Getting a link from a safari window
- From: "email@hidden" <email@hidden>
- Date: Sun, 23 May 2010 08:46:50 -0700
> 100's of pages Even if you made the script work, what would happen if you hit a dead-link?
The script knows the title of the window that will open, and the format of the URL, and can detect a dead link.
Turns out, the script doesn't have to wait for the entire page to open to get the title and the URL, so that sped things up a bit.
> I don't know why you must use System Events to achieve your goals, which I really don't know the motivation behind.
> But if there wasn't a very good reason to simulate the clicking on the links, I'd use curl or wget to access the links in the pages recursively to disk. That is if that is a viable solution for your problem.
I see system events' GUI scripting as a last resort, but when I use it, it's often the difference between making something work and giving up.
Because the links were generated dynamically, and couldn't be read from the source file, I didn't know of any other way to get the link text, which was where I was getting a unique code for the page that was opening.
With some timely advice from Bill and help from UI Browser, the script ran overnight and visited about 1600 pages, pulling data from about 900.
With Bill's latest post and Axel's Javascript advice, I've got some options for the next time I have to run it.
Thanks all!
ES _______________________________________________
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