CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Jan 2009
    Posts
    32

    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.

  2. #2
    Join Date
    Apr 2009
    Posts
    394

    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
  •  





Click Here to Expand Forum to Full Width

Featured