• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: How Do I Get the html Source for a Web Page into a String?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Prev by Date: Re: Delete a hidden file
  • Next by Date: Re: Delete a hidden file
  • Previous by thread: Re: Delete a hidden file
  • Next by thread: Re: How Do I Get the html Source for a Web Page into a String?
  • Index(es):
    • Date
    • Thread