• 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
DOMNode problems getting info out...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

DOMNode problems getting info out...


  • Subject: DOMNode problems getting info out...
  • From: jon <email@hidden>
  • Date: Sun, 23 Aug 2009 08:06:46 -0600

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 (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: DOMNode problems getting info out...
      • From: jon <email@hidden>
  • Prev by Date: Re: readInBackgroundAndNotify not working?
  • Next by Date: Re: DOMNode problems getting info out...
  • Previous by thread: Re: readInBackgroundAndNotify not working?
  • Next by thread: Re: DOMNode problems getting info out...
  • Index(es):
    • Date
    • Thread