Re: How Do I Get the html Source for a Web Page into a String?
Re: How Do I Get the html Source for a Web Page into a String?
- Subject: Re: How Do I Get the html Source for a Web Page into a String?
- From: Christopher Nebel <email@hidden>
- Date: Mon, 1 Nov 2010 12:26:22 -0700
On Oct 29, 2010, at 5:48 AM, Steve Thompson wrote:
> On 29 Oct 2010, at 13:34, S. J. Cunningham wrote:
>
>> Surely there is an easier way to do this directly. Now I am saving it to a file and reading the file back in.
>
> set myHTML to do shell script "curl http://www.apple.com/"
>
> Will copy a web page to myHTML
That's useful if you don't want to bother with the browser at all. If you're trying to get the source of a page currently displayed in Safari, use the "source" property, for example:
tell application "Safari" to set myHTML to the source of document 1
--Chris Nebel
AppleScript Engineering
_______________________________________________
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