I have found that there is extremely limited documentation dealing with DOMNodeLists and DOMNode...

for instance i found by pure accident that textContent works on a node, and found no documentation on it... and lots references to getAttribute or getElementID but can not get them to work...

so here is what i'm trying to do with code and maybe someone has figured this out...

thanks in advance..

here is some data in some HTML that I would like to parse, i've found how to get the text out, but i can't get this URL out....

<p> Aug 19 - <a href="http://whatever/sys/1331140637.html";>Two 1GB Apple matched pair RAM from a MacBook - $30 -</a><font size="-1"> (Louisville )</font></p>


here is the code i'm using to parse it.... most of it works, including the textContent, last two lines don't work...trying to get this "http://whatever/sys/1331140637.html"; into a NSString, or NSURL is failing me...


        DOMDocument *myDOMDocument = [[myWebView mainFrame] DOMDocument];
        DOMNodeList *allParas = [myDOMDocument getElementsByTagName:@"p"];

        DOMNode *node = [allParas item:0];

        NSString *top = [node textContent];


NSString *top2 = [node getAttribute:@"href"]; // this is way off, just trying to find methods, but i expected getAttribute to atleast be acknowledged as a method???? NSString *top4 = [node getElementById:@"href"]; // this is way off, but i expected getElementById to atleast be acknowledged as a method????


any help would be great...
thanks,
Jon.
_______________________________________________

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