I am having problem in getting response from remote server for that I have written following script response got correctly but the data on the page is not displayed it gives “–“ in place of grid data. It’s because when actual page load in web browser it shows “-“ until loading is not completed after that it gives actual value after successful completion of loading of the page.
Script I have written is as follows :
Script I have written is as follows :
Code:
<%
Response.Write("<SPAN class='tt'>Corn Futures (CZ)</SPAN>")
Const REMOTE_FILE_URL="http://www.cmegroup.com/trading/commodities/grain-and-oilseed/corn_quotes_globex.html"
Call ShowRemoteFile
Sub ShowRemoteFile
Dim objXML, strContents, arrLines
Dim x
Set objXML=Server.CreateObject("Microsoft.XMLHTTP")
'read text file...
objXML.Open "GET", REMOTE_FILE_URL, False
objXML.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
objXML.Send
strContents=objXML.ResponseText
Set objXML=Nothing
'split into lines and read line by line...
arrLines=Split(strContents, VBCrLf)
For x=0 To UBound(arrLines)
If InStr(arrLines(x), "<Table>") or InStr(arrLines(x), "<th") or InStr(arrLines(x), "<tr") Then
If not InStr(arrLines(x),"<i>") Then
'If InStr(arrLines(x), "<Table>") or InStr(arrLines(x), "<tr>") or InStr(arrLines(x), "<td>") or InStr(arrLines(x), "xmlns:xs") Then
Response.Write(arrLines(x)&"<br />")
'End If
End If
End If
Next
End Sub
%>
Comment