On Oct 10, 2009, at 1:01 PM, jon wrote:

drives me crazy the documentation... it is there, but you have to know what to look for before you ever go down the correct tangent.

There's certainly a lot of stuff, and it takes a while to learn what's in there. :/ The good part is that all these things make your job a lot easier.

Take a look at the "Tree-Based XML Programming Guide For Cocoa". (Pretty much wherever they say "XML" there, it includes regular HTML.)

To fetch and parse the page, you just use
[[NSXMLDocument alloc] initWithContentsOfURL: ... options: ... error: &error]; There's an option flag to "tidy" the syntax before parsing; definitely include that flag, because most real-world HTML needs tidying to be parseable as XML.

Then see the subsection "Querying An XML Document" and read the stuff about XPath. (You can also work with the tree of DOM nodes directly, pretty much like in WebView, just with different class names; but once you learn it, XPath is a lot more powerful.)

—Jens_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to