Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Will this always work?' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Will this always work?
Authored by: Krioni on Oct 18, '07 09:14:52PM

I believe I've noticed that, on some pages that have dynamic content, Safari and other browsers never really "finish" loading the page. Those might cause a problem for this type of script.

I've done a lot of work scripting web browsers since 2000 (including scripting IE back in OS 9 when IE was the only browser that you could use AppleScript to send Do Javascript commands . . . blech!). Later on, I graduated to URL Access Scripting Addition. In Mac OS X, URL Access Scripting had features that were completely broken (could not POST forms, for example, even though the commands were there). Switched to cURL, which was so much better.

All that said, if you're trying to script something where you want the user to see what you're doing and perhaps also interact with, scripting a web browser is all you can do. I suppose you could add something that, if it is still checking the status message after a cut-off time, checks the source for "</HTML>" or "</html>" to see if the page's content is all there (in theory). Perhaps even check for that first. It seems to get an error if you ask for source of a not-yet-loaded page - maybe that's something to try.

---
http://www.danshockley.com



[ Reply to This | # ]