I'm trying to maintain a piece of Visual Basic 6 software that was written to help expedite some text formatting for a department at my job. I'm not much of a computer engineer/scientist, but this piece of software falls into my jurisdiction as it was written by the gentleman I was hired to replace.
This tool was made to format a large amount of data in a short amount of time in order to eliminate manual formatting.
It seems to be that the WinHttpRequest that's passed to the URL as specified by the users of the program is mostly working. Yet when the ResponseBody property is called, the information that is expected by the written software is not being grabbed. I am not certain of how the data was hosted on the URL page before, but when the page source of the URL in question is examined via a web browser, the data that is expected to be retrieved is visible but appears to be hot-linked in from a different URL/location. But when the WinHttpReq.ResponseBody is made and dumped into a file locally, the information that is expected and needed is passed over.
It looks like it's passing over the data because the data is referenced in via separate hot-links at the original URL. My question is, what is the easiest way to retrieve the data that is visible when examining the page source, but isn't retrieved in the ResponseBody function call. The ResponseBody call also seems to be jettisoning the hot-linked URL's into the initial HTTP request URL, but I think the information and ID's used to build the hot-links is stored in the data.
' Create an array to hold the response data.
Dim d() As Byte
' Assemble an HTTP request.
WinHttpReq.Open "GET", ap_feedreq, False
' Set the user name and password.
WinHttpReq.SetCredentials ap_user, ap_pass, _
HTTPREQUEST_SETCREDENTIALS_FOR_SERVER
' Send the HTTP Request.
WinHttpReq.Send
' Display the response headers.
' MsgBox WinHttpReq.GetAllResponseHeaders & " " & WinHttpReq.ResponseText
If WinHttpReq.status = 200 Then
webwire1.StatusBar1.Panels(1).Text = "Authentication Complete .....
Parsing XML File"
webwire1.StatusBar1.Refresh
docpath1$ = mydocpath + "aptemp.txt"
Open docpath1$ For Binary As #1
d() = WinHttpReq.ResponseBody
Put #1, 1, d()
Close #1
Here's an image illustrating what I see to hopefully better show what I'm referring to.
Feed Body Comparison Browser vs. Local Data
The parsing function that was written within the software looks for the "nitf version =" flags to know when it's found the statistical data/tables that's to be used to format.
My question is, is there an easier, more elegant solution that will pull down all of the webpage source data at once as visible within a web browser? Or will I have to pull the response body, parse through the body text, build URL's using variables, pass more individual page URL requests, store that text, parse through that data, then load the parsed data back into the original body data?
I want to change the written software as little as possible.