Hi. I am an excellent
VB programmer but a poor web programmer. I am trying to get some data off a grid on a web page into a
vb app and I am having a terrible time doing it. The site also requires an id and password. The site is
http://ctmls.mlxchange.com/ and I'm using
VB 6 on Vista.
I don't care what form I get the data in but its not in the source when I view it or save the page. It looks like it is coming from javascript. Can I find out what script is getting the data and run it?
I think it changes pages in frames because the address never changes, but the display does. That's why I don't think I can use winsock. Inet doesn't work.
Here's how I get the data on the screen:
- Type in URL; go to site
- Login to site, frame changes
- Click "Search" from menu, frame changes
- Type in some criteria, click results
- Frame loads with a grid with data on I need to get into VB
The Userid is not mine, I am using it to write this program for the owner.
I found this code on another forum:
Private Function PrintDomBegin(hDoc As MSHTMLCtl.HTMLDocument) As Long
Dim str As String
Dim str2 As String
Dim ElemColl As Object 'MSHTMLCtl.HTMLElementCollection
If Not hDoc Is Nothing Then
frmDetail.List1.Clear
Set ElemColl = hDoc.getElementsByTagName("HTML")
str = PrintDom(ElemColl, str2, 0, 0)
frmDetail.Text1 = str
End If
'PrintDomBegin = ElemColl.Count
End Function
Private Function PrintDom(ByVal ElemColl As Object, ByRef ReturnStr As String, ByVal lngDepth As Long, lngIndex As Long) As String
Dim str As String
Dim strKey As String
Dim strElemName As String
Dim Elem As MSHTMLCtl.HTMLDTElement
For Each Elem In ElemColl
lngIndex = lngIndex + 1
strKey = "Frame: " & Trim(CStr(mlngFrameIndex)) & " - Depth: " & Trim(CStr(lngDepth)) & " #" & Trim(CStr(lngIndex))
mcol.Add Elem, strKey
frmDetail.List1.AddItem strKey
strElemName = Elem.getAttribute("ID")
If strElemName = "" Then
strElemName = "" & Elem.getAttribute("name")
If strElemName = "" Then
strElemName = "<no name>"
End If
End If
'If strElemName = "txtLogin" Then Debug.Print Elem.outerHTML
str = Space(lngDepth * 4)
str = str & (strElemName & ": " & Elem.tagName & "(Level " & lngDepth & ")")
ReturnStr = ReturnStr & str & vbCrLf
If (Elem.canHaveChildren) Then
PrintDom Elem.children, ReturnStr, lngDepth + 1, lngIndex
End If
str = ""
Next
PrintDom = ReturnStr
End Function
I found "txtLogon" with it, which I couldn't find anywhere else. But after I logon and try to look at other objects' outerHTML I get a "Permission Denied" error. I don't even know if anything useful is in there.
Any sugestions are appreciated.
[IMG]file:///C:/Users/Mar/AppData/Local/Temp/moz-screenshot-2.jpg[/IMG]