Hello!
Im trying to use Xpath to do collect some data from a page i save, RESULTS ON THE PAGE DIFFER.
I save everything(the html source) into my "C" Variable.
Thing is that, I can parse that like a LOOONGGG string(I do it with the mid() function and some ohter), but now I want to use the more flexible xpath cause there times when the search results generated from my page fails to load due to the string parsing.
So my questions are:
1. Why can't I get it to work? It does not load the html string, into the dom object? What do I do wrong?
2. I know the code structure for doing xpath queries, but do i do that with the dom object is it... domobject.SelectSingleNode("xpathquery")
I have attached my code below!
Im trying to use Xpath to do collect some data from a page i save, RESULTS ON THE PAGE DIFFER.
I save everything(the html source) into my "C" Variable.
Thing is that, I can parse that like a LOOONGGG string(I do it with the mid() function and some ohter), but now I want to use the more flexible xpath cause there times when the search results generated from my page fails to load due to the string parsing.
So my questions are:
1. Why can't I get it to work? It does not load the html string, into the dom object? What do I do wrong?
2. I know the code structure for doing xpath queries, but do i do that with the dom object is it... domobject.SelectSingleNode("xpathquery")
I have attached my code below!
Code:
Dim ie As Object
Set ie = CreateObject("internetexplorer.application")
ie.Visible = False
ie.Navigate "[URL unfurl="true"]https://the-page-with-my-data.com"[/URL]
Do While ie.ReadyState <> 4
DoEvents
Loop
C = ie.Document.body.innerhtml
Dim oXml As New MSXML2.DOMDocument
'Assign
UserForm1.TextBox88.Text = C
Dim oDom As MSXML2.DOMDocument
'
' 'Create the DomDocument Object
Set oDom = CreateObject("MSXML2.DOMDocument")
'
' 'Load entire Document before moving on
oDom.async = False
'
' 'Don't Validate
oDom.validateOnParse = False
'
oDom.Load (ie.Document.body.innerhtml)
'
MsgBox oDom.XML