• 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: Call getElementById in Cocoa
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Call getElementById in Cocoa


  • Subject: Re: Call getElementById in Cocoa
  • From: Mike Abdullah <email@hidden>
  • Date: Mon, 24 Nov 2008 17:34:23 +0000


On 24 Nov 2008, at 17:28, Jean-Daniel Dupas wrote:


Le 24 nov. 08 à 18:03, Mike Abdullah a écrit :


On 24 Nov 2008, at 16:45, John Terranova wrote:


On Nov 24, 2008, at 8:11 AM, Jean-Daniel Dupas wrote:

You call -mainFrameDocument on your WebView to get a DOMDocument instance, and have access to the DOM functions from here (there is no up-to-date doc of the Cocoa DOM API, you will have to check headers files directly to see what function is available, for example the DOMDocument.h file show you that there is a - [DomDocument getElementById:] method.

Is it possible to use the DOM functions without first creating the WebView?


I want to download a webpage and parse its contents without ever displaying the page. I currently parse the html text directly, but it is somewhat cumbersome. If I could just walk the DOM structure, then that would likely be much cleaner.

No, this is not possible. But there is no reason why you have to present the WebView to the user. Just stick it in an offscreen window and wait for it to load.


Mike.

I don't think you have to create an offscreen window at all. Creating the WebView and loading the URL programmatically is enough to access the dom tree.



That would be ideal, but I could swear I've run across WebKit documentation stating that a WebView must be placed within a window for it to operate properly._______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Call getElementById in Cocoa
      • From: Frédéric Testuz <email@hidden>
References: 
 >Call getElementById in Cocoa (From: Pierce Freeman <email@hidden>)
 >Re: Call getElementById in Cocoa (From: Jean-Daniel Dupas <email@hidden>)
 >Re: Call getElementById in Cocoa (From: John Terranova <email@hidden>)
 >Re: Call getElementById in Cocoa (From: Mike Abdullah <email@hidden>)
 >Re: Call getElementById in Cocoa (From: Jean-Daniel Dupas <email@hidden>)

  • Prev by Date: Re: NaN values from presentationLayer
  • Next by Date: Re: Multiple views in a nib file?
  • Previous by thread: Re: Call getElementById in Cocoa
  • Next by thread: Re: Call getElementById in Cocoa
  • Index(es):
    • Date
    • Thread