-
July 20th, 2010, 07:10 PM
#1
Way to get innertext of all childnodes of a node?
Hi,
Is there a way to get innerText from all childnodes of a node quickly? I am using VBA.
A web page has a node "H1" which has several childnodes, some of them are "p" and some are "STRONG". I need to get the text in these nodes. I tried to use getelementsbytagname and getattribute methods, but it is getting too complex. Is there an easy way?
Thanks,
MG.
-
July 21st, 2010, 10:14 PM
#2
Re: Way to get innertext of all childnodes of a node?
It is kind of like a recursive Dir search in that first you must get a reference to the top level and then with that, you get a reference to its children, and then their children, and so on and so on... BUT, what may be easier it to use the outer reference, get its innertext and parse it with vb's string handling function... It is kind of hard to tell without seeing the actual HTML or having a reference to the page...
Good Luck
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|