View Full Version : Reflect a Remote Input Box


dntchaseme
10-28-2005, 07:19 PM
I need to create a simple page or script of some sort that will look at this line:

<INPUT type=hidden name="PriceSell3" value="214.00">

The line above is located on a remote webpage. I do not own this webpage. I need to monitor the value of this input box so that I get an email or maybe a popup window each time the value changes.

Any help would be appreciated,

Imran Hashmi
www.visionstudio.co.uk
www.seo-professional.co.uk 0044-7969012441

ERE Breckenridge
01-30-2006, 08:39 PM
Is that legal? Isn't that scraping.

BSolveIT
02-02-2006, 07:31 AM
Hello!

I have the answer, but it's an ASP based solution. You could convert it to javascript though, without too much trouble.

In the following code sample, i'll assume the remote url is:
http://www.example.com/somepage.htm


URL = "http://www.example.com/somepage.htm"
Dim objXMLHTTP
Set objXMLHTTP = Server.CreateObject("Msxml2.ServerXMLHTTP")
objXMLHTTP.Open "GET", URL, False
objXMLHTTP.Send

IF objXMLHTTP.statusText = "OK" THEN
html = lcase(objXMLHTTP.responseText)
TheStart = InStr(1, html, "name=" & CHR(34) & "PriceSell3" & CHR(34)) + 25
TheEnd = InStr(TheStart, html, CHR(34))
Length = TheEnd - TheStart
GotValue= float(Mid(html,TheStart,Length))
END IF
Set objXMLHTTP = nothing


So, having got the value you want into your variable "GotValue", it's up to you what you want to do with it?

This solution doesn't involve any security context issues whatsoever. It retrieves the html source of the page using XML, which we can then work with as a text stream.

Easy!