Click here to Skip to main content
15,887,683 members
Please Sign up or sign in to vote.
1.00/5 (3 votes)
See more:
I want to fetch the integer data (say, 5) from the string Current Sch Rev No 5 of a webpage NERLDC (http://www.nerldc.org/Default.aspx) in a regular interval of 10 Sec. for comparing its changed value (say, 5) to its preceded value (say, 4, which was shown 10 Sec. back) to obtain subsequent changes in my VB10.0 application output, for example, reflecting the Current Status (say, Value Changed or Value Unchanged) in the application.

Please, can anyone write the solution, how to do that?

N.B.: (1)The transition of integer data (say, 5) is only visible using browsers IE or Mozilla Firefox

(2)This application is not linked to any database, its only for real-time application.
Posted
Updated 17-Jul-14 21:35pm
v2
Comments
[no name] 16-Jul-14 11:56am    
http://www.bing.com/search?q=vb.net+page+scraping
Sergey Alexandrovich Kryukov 16-Jul-14 12:45pm    
Bad idea, about 15 sec interval. Do you really want to create so much of dirt on the client's system?
—SA
Sandipans 18-Jul-14 2:28am    
It is to compare the values of the said string/integer in a loop, to the latest value and its preceded value for a doing calculation to specific output, that will change only current status of the running visual basic application. It is not intended to store output through database.

1 solution

Maybe something like this.

Dim http As HttpWebRequest = CType(WebRequest.Create("http://www.nerldc.org/Default.aspx", HttpWebRequest)
http.Timeout = 10000 ' 10 secs

http.UserAgent = "NERLDC"
Dim hwr As HttpWebResponse = CType(http.GetResponse, HttpWebResponse)
Dim enc As Encoding = Encoding.GetEncoding(1252)
Dim rdr as StreamReader = New StreamReader(hwr.GetResponseStream, enc)


Do
						
   Dim line As String = rdr.ReadLine
   If line IsNot Nothing Then
       'Do what you need to do
       
      'if it's a csv file, use the line below
       'Dim s() As String = line.Split(",")	
   End If
Loop Until line Is Nothing
 
Share this answer
 
Comments
Sandipans 18-Jul-14 3:39am    
I have made my query more elaborate and comprehensive for easing the solution. Please look into it.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900