473,387 Members | 1,903 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

How can i get response from remote server

6
can anybody tell me how can i get response from remote server. I am having problem in getting response from remote server for that I have written following script.

But its not showing values in the teble.
Expand|Select|Wrap|Line Numbers
  1. <%
  2. Response.Write("<SPAN class='tt'>Corn Futures (CZ)</SPAN>")
  3. Const REMOTE_FILE_URL="http://www.cmegroup.com/trading/commodities/grain-and-oilseed/corn_quotes_globex.html"
  4.  
  5. Call ShowRemoteFile
  6.  
  7. Sub ShowRemoteFile
  8. Dim objXML, strContents, arrLines
  9. Dim x
  10. Set objXML=Server.CreateObject("Microsoft.XMLHTTP")
  11.  
  12. 'read text file...
  13. objXML.Open "GET", REMOTE_FILE_URL, False
  14.  
  15. objXML.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
  16.  
  17. objXML.Send
  18. strContents=objXML.ResponseText
  19.  
  20. Set objXML=Nothing
  21.  
  22. 'split into lines and read line by line...
  23. arrLines=Split(strContents, VBCrLf)
  24. For x=0 To UBound(arrLines)
  25. If InStr(arrLines(x), "<Table>") or InStr(arrLines(x), "<th") or InStr(arrLines(x), "<tr") Then
  26. If not InStr(arrLines(x),"<i>") Then
  27. 'If InStr(arrLines(x), "<Table>") or InStr(arrLines(x), "<tr>") or InStr(arrLines(x), "<td>") or InStr(arrLines(x), "xmlns:xs") Then
  28. Response.Write(arrLines(x)&"<br />")
  29. 'End If
  30. End If
  31. End If
  32. Next
  33. End Sub
  34. %>
Jan 8 '10 #1
1 2595
jhardman
3,406 Expert 2GB
Your code works, the problem is that the website you are using is designed for a human audience, it first generates the table with only dashes, then puts all the data in it in a second step. Your code pulls up the correct table, but doesn't get the data updates. You need to find a webservice or something similar that has the data you need and is designed to be accessed programatically.

Jared
Jan 8 '10 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Stephan Bour | last post by:
I have a vexing problem I hope someone can help me with: I have an ASP.Net site that allows users to place orders for biological materials. Once the order is done though, I would like to have two...
0
by: ECathell | last post by:
I am trying to debug a remote application that works fine on my devmachine(localhost) but does not work as intended on my production server. i have setup a codeblock that is supposed to show a...
2
by: jim.clifford | last post by:
Hello. I have a slow response with a system that I am setting up. The OS is Win 2000 Server with SQL Server 2000. My first execution of the SQL procedure is slow (about 40 seconds), while the...
5
by: twiggy182 | last post by:
Hi, I really need you help because I'm not very familliar with ASP and I could not find any solution to my problem. To put you in situation, I have a CGI to which I send a file name, and that...
13
by: =?Utf-8?B?S2VzdGZpZWxk?= | last post by:
Hi Our company has a .Net web service that, when called via asp.net web pages across our network works 100%! The problem is that when we try and call the web service from a remote machine, one...
4
by: JDS | last post by:
I am a newbie to asp.net but have done traditional vb, asp and vb.net - please forgive any dumb questions! As a test I have a very simple page (Default.aspx) with a single button which then...
1
by: sanjupommen | last post by:
I am in the process of exploring the possibility of providing our products on databases other than Oracle.I am able to migrate the data, procedures etc without too much effort (latest version of DB2...
3
by: vtpvp82 | last post by:
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.