|
-
Feb 3rd, 2009, 07:11 PM
#1
Thread Starter
Member
[2008] HTML value between TAGS
I have a HTMLDocument, and in it there are a number of TAGS with a value between them:
Code:
<COLUMN><NAME>Subject</NAME></COLUMN>
<COLUMN><NAME>Status</NAME></COLUMN>
<COLUMN><NAME>Description</NAME></COLUMN>
I am struggling to get the values Subject, Status, Description from the HTML. This is what I am trying to do right now...
Code:
For Each htmlEl In htmlData.GetElementsByTagName("Name")
arrColumns(iCurCount).name = htmlEl.OuterHtml
Next
But this simply returns <NAME>.
OuterText, InnerText,InnerHTML all return Nothing, and children = 0.
I'm guessing Element level is the wrong place to be, but I don't see any other way around it.
Anybody have any experience in extracting this data?
-
Feb 3rd, 2009, 07:39 PM
#2
Re: [2008] HTML value between TAGS
this works:
vb Code:
Dim htmlData As New Xml.XmlDocument
htmlData.LoadXml(html)
'change xpath in selectnodes
For Each node As XmlNode In htmlData.SelectNodes("File/COLUMN/NAME")
MsgBox(node.InnerText)
Next
- Coding Examples:
- Features:
- Online Games:
- Compiled Games:
-
Feb 4th, 2009, 03:58 AM
#3
Thread Starter
Member
Re: [2008] HTML value between TAGS
Thanks for that, back on the right track again 
The full HTML is badly formed, and shifting it to a XML class failed miserably. But for this section in isolation, I can do what you suggested.
Thanks!
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
|